# HG changeset patch # User Sebastien Jodogne # Date 1544717871 -3600 # Node ID 8a15bb3576c2f9d2898659f55a21e0efd36e6d3e # Parent 45a4a1571b4eb83a98e96fbd6655c7f8716834ca make "/tools/create-dicom" more tolerant to invalid specific character set diff -r 45a4a1571b4e -r 8a15bb3576c2 NEWS --- a/NEWS Thu Dec 13 15:14:39 2018 +0100 +++ b/NEWS Thu Dec 13 17:17:51 2018 +0100 @@ -2,6 +2,13 @@ =============================== +Maintenance +----------- + +* "/tools/create-dicom" is more tolerant to invalid specific character set + + + Version 1.5.0 (2018-12-10) ========================== diff -r 45a4a1571b4e -r 8a15bb3576c2 OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp Thu Dec 13 15:14:39 2018 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp Thu Dec 13 17:17:51 2018 +0100 @@ -440,6 +440,7 @@ // Select one existing child instance of the parent resource, to // retrieve all its tags Json::Value siblingTags; + std::string siblingInstanceId; { // Retrieve all the instances of the parent resource @@ -452,7 +453,8 @@ throw OrthancException(ErrorCode_InternalError); } - context.ReadDicomAsJson(siblingTags, siblingInstances.front()); + siblingInstanceId = siblingInstances.front(); + context.ReadDicomAsJson(siblingTags, siblingInstanceId); } @@ -463,11 +465,14 @@ if (siblingTags.isMember(SPECIFIC_CHARACTER_SET)) { Encoding encoding; + if (!siblingTags[SPECIFIC_CHARACTER_SET].isMember("Value") || siblingTags[SPECIFIC_CHARACTER_SET]["Value"].type() != Json::stringValue || !GetDicomEncoding(encoding, siblingTags[SPECIFIC_CHARACTER_SET]["Value"].asCString())) { - throw OrthancException(ErrorCode_CreateDicomParentEncoding); + LOG(WARNING) << "Instance with an incorrect Specific Character Set, " + << "using the default Orthanc encoding: " << siblingInstanceId; + encoding = GetDefaultDicomEncoding(); } dicom.SetEncoding(encoding);