# HG changeset patch # User Sebastien Jodogne # Date 1562678990 -7200 # Node ID 418a89acef3b1c316677d65d732869776a3eec98 # Parent be2eeeaad86a4d888d5a9af73eacacb102eddc66 In DICOM-to-DICOMweb/JSON conversion, be more tolerant wrt. invalid DICOM files diff -r be2eeeaad86a -r 418a89acef3b Core/DicomParsing/DicomWebJsonVisitor.cpp --- a/Core/DicomParsing/DicomWebJsonVisitor.cpp Tue Jul 09 14:44:26 2019 +0200 +++ b/Core/DicomParsing/DicomWebJsonVisitor.cpp Tue Jul 09 15:29:50 2019 +0200 @@ -653,7 +653,15 @@ } catch (boost::bad_lexical_cast&) { - throw OrthancException(ErrorCode_BadFileFormat); + std::string tmp; + if (value.size() < 64 && + Toolbox::IsAsciiString(value)) + { + tmp = ": " + value; + } + + LOG(WARNING) << "Ignoring DICOM tag (" << tag.Format() + << ") with invalid content for VR " << EnumerationToString(vr) << tmp; } } }