From 4787acff35a573e351cc3e1c13a54d7965dc26d0 Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 23 Nov 2017 16:04:29 -0500 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33119 --- coders/miff.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coders/miff.c b/coders/miff.c index 8fad09660..554cd93a4 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -2034,7 +2034,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); - if ((image->storage_class != PseudoClass) && (image->depth >= 32) && + if ((image->storage_class != PseudoClass) && (image->depth >= 16) && (quantum_info->format == UndefinedQuantumFormat) && (IsHighDynamicRangeImage(image,exception) != MagickFalse)) { @@ -2042,6 +2042,9 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, if (status == MagickFalse) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); } + else + if (image->depth < 16) + DeleteImageProperty(image,"quantum:format"); compression=UndefinedCompression; if (image_info->compression != UndefinedCompression) compression=image_info->compression; -- 2.50.1