]> granicus.if.org Git - imagemagick/commitdiff
Correct the width and height of the image after it has been read with preserve-orient...
authorDirk Lemstra <dirk@lemstra.org>
Mon, 7 Jan 2019 20:22:40 +0000 (21:22 +0100)
committerDirk Lemstra <dirk@lemstra.org>
Mon, 7 Jan 2019 20:23:30 +0000 (21:23 +0100)
coders/heic.c

index 1de1b96cbb532763204b07adb74cbad65e98977b..a27d53ea5552d1b5477bda16e12a61d3bc2e75b0 100644 (file)
@@ -297,7 +297,12 @@ static Image *ReadHEICImage(const ImageInfo *image_info,
   error=heif_decode_image(image_handle,&heif_image,heif_colorspace_YCbCr,
     heif_chroma_420,decode_options);
   if (decode_options != (struct heif_decoding_options *) NULL)
-    heif_decoding_options_free(decode_options);
+    {
+      /* Correct the width and height of the image */
+      image->columns=(size_t) heif_image_get_width(heif_image,heif_channel_Y);
+      image->rows=(size_t) heif_image_get_height(heif_image,heif_channel_Y);
+      heif_decoding_options_free(decode_options);
+    }
   if (IsHeifSuccess(&error,image,exception) == MagickFalse)
     {
       heif_image_handle_release(image_handle);