Commit 21485dfd6 for imagemagick.org
commit 21485dfd60f5d4b35d8f74180fa6388a08319405
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Wed Jan 7 17:14:15 2026 +0100
Corrected check to determine if the alpha channel is enabled.
diff --git a/coders/heic.c b/coders/heic.c
index 7676e9a97..5287b0fdc 100644
--- a/coders/heic.c
+++ b/coders/heic.c
@@ -1249,7 +1249,7 @@ static MagickBooleanType WriteHEICImageRGBA(Image *image,
{
*(q++)=ScaleQuantumToChar(GetPixelGreen(image,p));
*(q++)=ScaleQuantumToChar(GetPixelBlue(image,p));
- if (image->alpha_trait != UndefinedPixelTrait)
+ if ((image->alpha_trait & BlendPixelTrait) != 0)
*(q++)=ScaleQuantumToChar(GetPixelAlpha(image,p));
}
p+=(ptrdiff_t) GetPixelChannels(image);
@@ -1334,7 +1334,7 @@ static MagickBooleanType WriteHEICImageRRGGBBAA(Image *image,
pixel=ScaleQuantumToShort(GetPixelBlue(image,p)) >> shift;
*(q++)=(uint8_t) (pixel & 0xff);
*(q++)=(uint8_t) (pixel >> 8);
- if (image->alpha_trait != UndefinedPixelTrait)
+ if ((image->alpha_trait & BlendPixelTrait) != 0)
{
pixel=ScaleQuantumToShort(GetPixelAlpha(image,p)) >> shift;
*(q++)=(uint8_t) (pixel & 0xff);