Read the whole image @ image.jp2[0] or an individual tile @ image.jp2[1], image.jp2[2]
authorCristy <urban-warrior@imagemagick.org>
Fri, 2 Oct 2015 21:43:23 +0000 (17:43 -0400)
committerCristy <urban-warrior@imagemagick.org>
Fri, 2 Oct 2015 21:43:23 +0000 (17:43 -0400)
coders/jp2.c

index fa5dcdfb6405e668bc945c0f9aecd9139056fccf..b05c03fd16b0673df9fd3e72e2f6f004f00e78cd 100644 (file)
@@ -366,9 +366,9 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
           ThrowReaderException(DelegateError,"UnableToDecodeImageFile");
         }
     }
-  if (image_info->number_scenes != 0)
+   if ((image_info->number_scenes != 0) && (image_info->scene != 0))
     jp2_status=opj_get_decoded_tile(jp2_codec,jp2_stream,jp2_image,
-      (unsigned int) image_info->scene);
+      (unsigned int) image_info->scene-1);
   else
     if (image->ping == MagickFalse)
       {