# HG changeset patch # User Sebastien Jodogne # Date 1716023664 -7200 # Node ID 40a093f90be6931f3b30ab8a06a37ec98efcb852 # Parent bf4c4e4e71986f76a363117c2e45230d18bdb1bc optimization diff -r bf4c4e4e7198 -r 40a093f90be6 Sources/Plugin.cpp --- a/Sources/Plugin.cpp Fri May 17 17:16:07 2024 +0200 +++ b/Sources/Plugin.cpp Sat May 18 11:14:24 2024 +0200 @@ -943,12 +943,6 @@ "POST body missing string field \"" + std::string(KEY_CONTENT) + "\""); } - std::string nexus; - Orthanc::Toolbox::DecodeBase64(nexus, body[KEY_CONTENT].asString()); - - std::string raw; - Orthanc::Toolbox::EncodeDataUriScheme(raw, "application/octet-stream", nexus); - Json::Value creationBody = Json::objectValue; creationBody[KEY_TAGS] = body[KEY_TAGS]; @@ -957,7 +951,8 @@ creationBody[KEY_TAGS][Orthanc::DICOM_TAG_MODALITY.Format()] = "OT"; creationBody[KEY_TAGS][DICOM_TAG_CREATOR_VERSION_UID.Format()] = GetCreatorVersionUid(ORTHANC_STL_VERSION); creationBody[KEY_TAGS][Orthanc::DicomTag(ORTHANC_STL_PRIVATE_GROUP, ORTHANC_STL_CREATOR_ELEMENT).Format()] = ORTHANC_STL_PRIVATE_CREATOR; - creationBody[KEY_TAGS][Orthanc::DicomTag(ORTHANC_STL_PRIVATE_GROUP, ORTHANC_STL_NEXUS_ELEMENT).Format()] = raw; + creationBody[KEY_TAGS][Orthanc::DicomTag(ORTHANC_STL_PRIVATE_GROUP, ORTHANC_STL_NEXUS_ELEMENT).Format()] = + "data:application/octet-stream;base64," + body[KEY_CONTENT].asString(); creationBody[KEY_PRIVATE_CREATOR] = ORTHANC_STL_PRIVATE_CREATOR; if (body.isMember(KEY_PARENT))