From ed70519396faf620e6ce29da720b9e4ad0e8f5a4 Mon Sep 17 00:00:00 2001 From: REDxEYE Date: Sat, 13 Aug 2022 23:46:02 +0300 Subject: [PATCH] Add better check for DXT1 with alpha --- src/libImaging/BcnEncode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libImaging/BcnEncode.c b/src/libImaging/BcnEncode.c index 3b17fd24b..ca35ab0af 100644 --- a/src/libImaging/BcnEncode.c +++ b/src/libImaging/BcnEncode.c @@ -121,10 +121,10 @@ get_closest_color_index(const UINT16 *colors, UINT16 color) { int encode_bc1(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { - UINT8* dst = buf; + UINT8 *dst = buf; UINT8 no_alpha = 0; INT32 block_index; - if (strchr(im->mode, 'A') == NULL) { + if (strcmp(((BCNSTATE *)state->context)->pixel_format, "DXT1A") != 0) { no_alpha = 1; } INT32 block_count = (im->xsize * im->ysize) / 16;