comparison Plugin/DecodedImageAdapter.cpp @ 234:083d0cbcbac4 transcoding

improved error message
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 11 May 2020 16:02:34 +0200
parents cce89307af28
children 4e9d30c19b4b
comparison
equal deleted inserted replaced
233:e866849335fd 234:083d0cbcbac4
123 123
124 124
125 bool DecodedImageAdapter::Create(std::string& content, 125 bool DecodedImageAdapter::Create(std::string& content,
126 const std::string& uri) 126 const std::string& uri)
127 { 127 {
128 std::string message = "Decoding DICOM instance: " + uri; 128 LOG(INFO) << "Decoding DICOM instance: " << uri;
129 OrthancPluginLogInfo(context_, message.c_str());
130 129
131 CompressionType type; 130 CompressionType type;
132 uint8_t level; 131 uint8_t level;
133 std::string instanceId; 132 std::string instanceId;
134 unsigned int frameIndex; 133 unsigned int frameIndex;
136 if (!ParseUri(type, level, instanceId, frameIndex, uri)) 135 if (!ParseUri(type, level, instanceId, frameIndex, uri))
137 { 136 {
138 return false; 137 return false;
139 } 138 }
140 139
141
142 bool ok = false; 140 bool ok = false;
143 141
144 Json::Value tags; 142 Json::Value tags;
145 std::string dicom; 143 std::string dicom;
146 if (!GetStringFromOrthanc(dicom, context_, "/instances/" + instanceId + "/file") || 144 if (!GetStringFromOrthanc(dicom, context_, "/instances/" + instanceId + "/file") ||
178 content = writer.write(json); 176 content = writer.write(json);
179 return true; 177 return true;
180 } 178 }
181 else 179 else
182 { 180 {
183 char msg[1024]; 181 LOG(WARNING) << "Unable to decode the following instance: " << uri;
184 sprintf(msg, "Unable to decode the following instance: %s", uri.c_str());
185 OrthancPluginLogWarning(context_, msg);
186 return false; 182 return false;
187 } 183 }
188 } 184 }
189 185
190 186