From 013e870519996fd792ed849cf14eee91c8284131 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Tue, 19 Aug 2025 08:04:35 +0200 Subject: [PATCH] Change the colorspace to GrayScale when an exr image only has a single Y channel (#8305) --- coders/exr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coders/exr.c b/coders/exr.c index 81c79ae050..e6664938c1 100644 --- a/coders/exr.c +++ b/coders/exr.c @@ -281,6 +281,8 @@ static MagickBooleanType InitializeEXRChannels(Image *image,exr_context_t ctxt, status=SetPixelMetaChannels(image,number_meta_channels,exception); if (status == MagickFalse) return(status); + if ((decoder.channel_count == 1) && (pixel_channels[0] == IndexPixelChannel)) + image->colorspace=GRAYColorspace; *data=(uint8_t *) AcquireQuantumMemory(*pixel_size,pixel_count); if (*data == (uint8_t*)NULL) {