Skip to content

Commit b3af769

Browse files
committed
Set alpha channel for OpenJPEG
1 parent 569751e commit b3af769

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libImaging/Jpeg2KEncode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ j2k_encode_entry(Imaging im, ImagingCodecState state) {
487487
goto quick_exit;
488488
}
489489

490+
if (strcmp(im->mode, "RGBA") == 0) {
491+
image->comps[3].alpha = 1;
492+
}
493+
490494
opj_set_error_handler(codec, j2k_error, context);
491495
opj_set_info_handler(codec, j2k_warn, context);
492496
opj_set_warning_handler(codec, j2k_warn, context);

0 commit comments

Comments
 (0)