Bug 25818

Summary: The GIMP 2.10 will not import and display some (colour profile) ?jp2 images correctly.
Product: Mageia Reporter: Thomas Andrews <andrewsfarm>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: Normal CC: lewyssmith
Version: 7Keywords: UPSTREAM
Target Milestone: ---   
Hardware: All   
OS: Linux   
URL: https://github.com/uclouvain/openjpeg/issues/1103
Whiteboard:
Source RPM: CVE:
Status comment:
Attachments: test jpeg2000 image that fails to load into GIMP

Description Thomas Andrews 2019-12-04 02:27:26 CET
Description of problem:
If a user attempts to load a jp2 (jpeg2000) image into The Gimp, it will not display properly. All I see is a rectangle of solid color.

Version-Release number of selected component (if applicable):
gimp 2.10.10-1

How reproducible:
Always
Seen while testing an update candidate for openjpeg2. Research on the Web indicates that with version 2.10, the GIMP was switched from using jasper for jpeg2000 to using openjpeg2. During testing, ImageMagick worked correctly on a test image, while The GIMP did not.
Comment 1 Thomas Andrews 2019-12-04 02:30:06 CET
Created attachment 11383 [details]
test jpeg2000 image that fails to load into GIMP
Comment 2 Lewis Smith 2019-12-09 22:00:23 CET
Hello TJ

gimp-2.10.10-1.mga7
I have a number of jpeg2000 images with extensions of .jp2 or .j2k . Gimp opened them all OK, but some popped a dialogue about colourspace: "Opening JPEG 2000 codestream"; I used the proposed sRGB.

However, your example not only popped a much more complicated dialogue "Import the image from a colour profile", with a posterized image thumbnail alongside; but the RH Preview panel, and Convert, yielded a bright green square.
By accident, Esc'ing the dialogue yielded the posterized 'relax' image. So something to do with colour profiles?

An anonymous 'Image Viewer' program does not recognise any JP2000 images; Pix showed your green square, then other jp2/j2k images, all tiny; Ristretto did not recognise JP2K images at all; Gwenview offers only straight JPEG.

I did not see your correct sample image until trying ImageMagick/display!

 https://github.com/uclouvain/openjpeg/issues/1103
discusses this very test image, and includes:
"gimp-2.8.22 shows the file relax.jp2"
"GIMP 2.10 will stop being able to show this file as we are moving to OpenJPEG"
Even better:
"the way to see an acceptable image is by loading the image while keeping the profile (don't "convert" to GIMP built-in sRGB), then go to Image > Color management > Discard Color Profile. Then you get something with believable color"
And this works!

Would you agree to closing this bug?

URL: (none) => https://github.com/uclouvain/openjpeg/issues/1103
CC: (none) => lewyssmith
Summary: The GIMP 2.10 will not import and display jp2 images correctly. => The GIMP 2.10 will not import and display some (colour profile) ?jp2 images correctly.
Keywords: (none) => UPSTREAM

Comment 3 Thomas Andrews 2019-12-09 22:57:07 CET
You might know, I'd download the one sample image The GIMP wouldn't load without troubles. It seems like I used it once before when testing a jasper update in Mageia 6, but that was some time ago.

I tried the "even better" procedure, and it does indeed work for me, too. So yes, since the image will load and display, even though you have to jump through a hoop or two to do it, I see no reason to keep this bug open.

Resolution: (none) => INVALID
Status: NEW => RESOLVED

Comment 4 Thomas Andrews 2019-12-09 23:00:06 CET
Invalid doesn't seem quite right. This is closer.

Resolution: INVALID => WORKSFORME

Comment 5 Lewis Smith 2019-12-10 10:24:07 CET
Agree; this is what I had in mind. And thanks.