Skip to content

Commit 58da20b

Browse files
committed
Fix #5310
Prevent conversion of masked images to JPEG.
1 parent 486becc commit 58da20b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21619,8 +21619,8 @@ def _make_image_dict(img, img_dict):
2161921619
mupdf.FzColorParams(mupdf.fz_default_color_params),
2162021620
)
2162121621
ext = "png"
21622-
elif ext == "jpeg" and img.n() == 4:
21623-
# JPEG with CMYK: invert colors
21622+
elif ext == "jpeg" and img.n() == 4 and not img.mask().fz_image_size():
21623+
# JPEG with CMYK, no mask: invert colors
2162421624
res = mupdf.fz_new_buffer_from_image_as_jpeg(
2162521625
img,
2162621626
mupdf.FzColorParams(mupdf.fz_default_color_params),

0 commit comments

Comments
 (0)