changeset 1043:be849646b2bf

sample
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Jul 2014 15:59:06 +0200
parents 8d1845feb277
children 6d90e2bcab60
files Plugins/Samples/Basic/Plugin.c
diffstat 1 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/Basic/Plugin.c	Thu Jul 17 15:55:40 2014 +0200
+++ b/Plugins/Samples/Basic/Plugin.c	Thu Jul 17 15:59:06 2014 +0200
@@ -88,20 +88,22 @@
   if (request->method != OrthancPluginHttpMethod_Get)
   {
     OrthancPluginSendMethodNotAllowed(context, output, "GET");
-    return -1;
+  }
+  else
+  {
+    value = 0;
+    for (y = 0; y < 256; y++)
+    {
+      for (x = 0; x < 256; x++, value++)
+      {
+        buffer[value] = value;
+      }
+    }
+
+    OrthancPluginCompressAndAnswerPngImage(context, output, OrthancPluginPixelFormat_Grayscale16,
+                                           256, 256, sizeof(uint16_t) * 256, buffer);
   }
 
-  value = 0;
-  for (y = 0; y < 256; y++)
-  {
-    for (x = 0; x < 256; x++, value++)
-    {
-      buffer[value] = value;
-    }
-  }
-
-  OrthancPluginCompressAndAnswerPngImage(context, output, OrthancPluginPixelFormat_Grayscale16,
-                                         256, 256, sizeof(uint16_t) * 256, buffer);
   return 0;
 }