Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

JPEG2000 image read incorrectly

Open sl2c opened this issue 2 years ago • 3 comments

When doing

from PIL import Image
Image.open('test.jp2').show()

on the file test.jp2.zip an apparently incorrect result is displayed.

I have checked this with both the latest Pillow-10.1.0 as well as my reference Pillow-9.4.0: both results are identical and both are incorrect.

sl2c avatar Nov 01 '23 03:11 sl2c

Am I correct in saying that you created this image

but were expecting this?

I see there is a "pclr" box in the image. It looks like an RGB palette that we're not handling yet. Is the image you attached one that can be added a test image, and distributed under Pillow's license?

radarhere avatar Nov 01 '23 04:11 radarhere

I vaguely remember that I got this image from some student lecture notes that were freely distributed on the web. That is to say, I am not the author of this image.

sl2c avatar Nov 04 '23 19:11 sl2c

It seems to me that https://github.com/uclouvain/openjpeg/pull/1463 is relevant, and we might have an easier time addressing this once the next version of OpenJPEG is released.

radarhere avatar Jan 20 '24 05:01 radarhere

It turns out that https://github.com/uclouvain/openjpeg/pull/1463 didn't help.

I've created https://github.com/python-pillow/Pillow/pull/7867 to resolve this.

radarhere avatar Mar 11 '24 08:03 radarhere