diff OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp @ 1695:18c02c6987d5

fix for encodings
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 08 Oct 2015 14:34:19 +0200
parents 26083d84d237
children b62c2e706c13
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp	Thu Oct 08 13:49:20 2015 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp	Thu Oct 08 14:34:19 2015 +0200
@@ -504,7 +504,6 @@
         throw OrthancException(ErrorCode_CreateDicomNotString);
       }
 
-      std::string value = tags[name].asString();
       DicomTag tag = FromDcmtkBridge::ParseTag(name);
 
       if (tag != DICOM_TAG_SPECIFIC_CHARACTER_SET)
@@ -529,16 +528,9 @@
         {
           throw OrthancException(ErrorCode_CreateDicomUseContent);
         }
-        else if (decodeBinaryTags &&
-                 boost::starts_with(value, "data:application/octet-stream;base64,"))
-        {
-          std::string mime, binary;
-          Toolbox::DecodeDataUriScheme(mime, binary, value);
-          dicom.Replace(tag, binary);
-        }
         else
         {
-          dicom.Replace(tag, Toolbox::ConvertFromUtf8(value, dicom.GetEncoding()));
+          dicom.Replace(tag, tags[name], decodeBinaryTags);
         }
       }
     }