From 74c8d1f57fd76826a4b38a0e3bb5c71166cad809 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 7 Jan 2019 21:22:40 +0100 Subject: [PATCH] Correct the width and height of the image after it has been read with preserve-orientation enabled. --- coders/heic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coders/heic.c b/coders/heic.c index 1de1b96cb..a27d53ea5 100644 --- a/coders/heic.c +++ b/coders/heic.c @@ -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); -- 2.40.0