From: Dirk Lemstra Date: Thu, 8 Aug 2019 11:20:27 +0000 (+0200) Subject: Read the compression information from the header. X-Git-Tag: 7.0.8-60~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b78ad8630e7dbee3b523c552c1e5cb652df2885;p=imagemagick Read the compression information from the header. --- diff --git a/coders/exr.c b/coders/exr.c index ff712808c..da472796c 100644 --- a/coders/exr.c +++ b/coders/exr.c @@ -160,6 +160,9 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) ImfRgba *scanline; + int + compression; + MagickBooleanType status; @@ -205,6 +208,26 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) image->alpha_trait=BlendPixelTrait; (void) SetImageColorspace(image,RGBColorspace,exception); image->gamma=1.0; + image->compression=NoCompression; + compression=ImfHeaderCompression(hdr_info); + if (compression == IMF_RLE_COMPRESSION) + image->compression=RLECompression; + if (compression == IMF_ZIPS_COMPRESSION) + image->compression=ZipSCompression; + if (compression == IMF_ZIP_COMPRESSION) + image->compression=ZipCompression; + if (compression == IMF_PIZ_COMPRESSION) + image->compression=PizCompression; + if (compression == IMF_PXR24_COMPRESSION) + image->compression=Pxr24Compression; +#if defined(IMF_B44_COMPRESSION) + if (compression == IMF_B44_COMPRESSION) + image->compression=B44Compression; +#endif +#if defined(IMF_B44A_COMPRESSION) + if (compression == IMF_B44A_COMPRESSION) + image->compression=B44ACompression; +#endif if (image_info->ping != MagickFalse) { (void) ImfCloseInputFile(file);