comparison OrthancServer/ServerContext.cpp @ 3904:c62f84c7eda9 transcoding

fixing incorrect behavior in MemoryBufferTranscoder
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 May 2020 17:21:20 +0200
parents d1273d7cc200
children f0dd5ded8927
comparison
equal deleted inserted replaced
3903:d1273d7cc200 3904:c62f84c7eda9
1159 bool& hasSopInstanceUidChanged, 1159 bool& hasSopInstanceUidChanged,
1160 ParsedDicomFile& dicom, // Possibly modified 1160 ParsedDicomFile& dicom, // Possibly modified
1161 const std::set<DicomTransferSyntax>& allowedSyntaxes, 1161 const std::set<DicomTransferSyntax>& allowedSyntaxes,
1162 bool allowNewSopInstanceUid) 1162 bool allowNewSopInstanceUid)
1163 { 1163 {
1164 DicomTransferSyntax inputSyntax;
1165 if (!FromDcmtkBridge::LookupOrthancTransferSyntax(inputSyntax, dicom.GetDcmtkObject()))
1166 {
1167 throw OrthancException(ErrorCode_BadFileFormat,
1168 "Cannot determine the source transfer syntax during transcoding");
1169 }
1170
1164 IDicomTranscoder* transcoder = dcmtkTranscoder_.get(); 1171 IDicomTranscoder* transcoder = dcmtkTranscoder_.get();
1165 1172
1166 #if ORTHANC_ENABLE_PLUGINS == 1 1173 #if ORTHANC_ENABLE_PLUGINS == 1
1167 if (HasPlugins()) 1174 if (HasPlugins())
1168 { 1175 {
1172 1179
1173 if (transcoder == NULL) 1180 if (transcoder == NULL)
1174 { 1181 {
1175 throw OrthancException(ErrorCode_InternalError); 1182 throw OrthancException(ErrorCode_InternalError);
1176 } 1183 }
1177 else if (transcoder->HasInplaceTranscode()) 1184 else if (transcoder->HasInplaceTranscode(inputSyntax, allowedSyntaxes))
1178 { 1185 {
1179 if (transcoder->InplaceTranscode(hasSopInstanceUidChanged, dicom.GetDcmtkObject(), 1186 if (transcoder->InplaceTranscode(hasSopInstanceUidChanged, dicom.GetDcmtkObject(),
1180 allowedSyntaxes, allowNewSopInstanceUid)) 1187 allowedSyntaxes, allowNewSopInstanceUid))
1181 { 1188 {
1182 // In-place transcoding is supported and has succeeded 1189 // In-place transcoding is supported and has succeeded