# HG changeset patch # User Sebastien Jodogne # Date 1544717792 -3600 # Node ID 9f859a18cbc2ca9a8ef935d3764116079a2ff86a # Parent 0e1755e5efd04c6d098cb788bd8086f6cda4e702 make "/tools/create-dicom" more tolerant to invalid specific character set diff -r 0e1755e5efd0 -r 9f859a18cbc2 NEWS --- a/NEWS Thu Dec 13 12:37:10 2018 +0100 +++ b/NEWS Thu Dec 13 17:16:32 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 0e1755e5efd0 -r 9f859a18cbc2 OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp Thu Dec 13 12:37:10 2018 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp Thu Dec 13 17:16:32 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);