# HG changeset patch # User Sebastien Jodogne # Date 1561468597 -7200 # Node ID c86dba636bc4b3110006e76ebc20a192d0d3be84 # Parent 496573be17946b3c630e1b9d2fa7ebab97267390 fix frame numbering diff -r 496573be1794 -r c86dba636bc4 Plugin/Plugin.cpp --- a/Plugin/Plugin.cpp Mon Jun 24 17:15:59 2019 +0200 +++ b/Plugin/Plugin.cpp Tue Jun 25 15:16:37 2019 +0200 @@ -432,9 +432,11 @@ std::map headers; headers["Accept"] = Orthanc::EnumerationToString(mime); + // NB: In DICOMweb, the "frame" parameter is in the range [1..N], whereas + // Orthanc uses range [0..N-1], hence the "-1" below OrthancPlugins::MemoryBuffer buffer; if (buffer.RestApiGet("/instances/" + instanceId + "/frames/" + - boost::lexical_cast(frame) + "/preview", headers, false)) + boost::lexical_cast(frame - 1) + "/preview", headers, false)) { OrthancPluginAnswerBuffer(context, output, buffer.GetData(), buffer.GetSize(), Orthanc::EnumerationToString(mime)); @@ -448,7 +450,7 @@ const char* url, const OrthancPluginHttpRequest* request) { - AnswerFrameRendered(output, 0, request); + AnswerFrameRendered(output, 1 /* first frame */, request); }