From c108d9ddb033e3e70f7261b7f1b7fc9d81c00259 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 22 Jul 2023 20:00:36 +1000 Subject: [PATCH] Set alpha channel when saving LA in OpenJPEG --- src/libImaging/Jpeg2KEncode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libImaging/Jpeg2KEncode.c b/src/libImaging/Jpeg2KEncode.c index de8586706..3295373fd 100644 --- a/src/libImaging/Jpeg2KEncode.c +++ b/src/libImaging/Jpeg2KEncode.c @@ -490,6 +490,8 @@ j2k_encode_entry(Imaging im, ImagingCodecState state) { if (strcmp(im->mode, "RGBA") == 0) { image->comps[3].alpha = 1; + } else if (strcmp(im->mode, "LA") == 0) { + image->comps[1].alpha = 1; } opj_set_error_handler(codec, j2k_error, context);