Bug 244528 - [GTK][WPE] Decoding artifacts in JPEG2000 images
Summary: [GTK][WPE] Decoding artifacts in JPEG2000 images
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-30 00:49 PDT by Adrian Perez
Modified: 2022-08-30 01:20 PDT (History)
2 users (show)

See Also:


Attachments
Screenshot showing the same JPEG2000 file loaded in Epiphany/WebKitGTK, and GIMP (3.57 MB, image/png)
2022-08-30 00:49 PDT, Adrian Perez
no flags Details
Example JP2 which shows decoding artifacts (492.97 KB, image/jp2)
2022-08-30 00:50 PDT, Adrian Perez
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2022-08-30 00:49:15 PDT
Created attachment 462000 [details]
Screenshot showing the same JPEG2000 file loaded in Epiphany/WebKitGTK, and GIMP

This can be seen browsing the Epson website, e.g. https://www.epson.co.uk
and in particular the big carousel images, like this one: 

  https://i8.amplience.net/i/epsonemear/home_0722_cashback-slide_uk?$ct2-xl-img1$&$poi$&fmt=jp2

(The website uses “fmt=auto” in the URL, which makes the server use JPEG2000
when loading the URL with WebKitGTK/WPE based browsers; but I have replaced the
link here to have “fmt=jp2” to force the download of the JP2 file when opened
in browsers that do not support the format.)

I am attaching a screenshot of Epiphany (WebKitGTK) and GIMP displaying the
aforementioned file, where the artifacts can be seen, for those who cannot
load JP2 files in their browsers.
Comment 1 Adrian Perez 2022-08-30 00:50:43 PDT
Created attachment 462001 [details]
Example JP2 which shows decoding  artifacts

Here's the JP2 file, in case it disappears from the web.
Comment 2 Adrian Perez 2022-08-30 01:15:28 PDT
One more data point: in the testing I have been doing, both WebKit
and GIMP are using the same OpenJPEG library, version 2.5.0:

  % readelf -d /usr/lib/gimp/2.99/plug-ins/file-jp2-load/file-jp2-load | grep 'NEEDED.*openjp'
   0x0000000000000001 (NEEDED)             Shared library: [libopenjp2.so.7]
  % readelf -d /usr/lib/libwebkit2gtk-4.1.so | grep 'NEEDED.*openjp'
   0x0000000000000001 (NEEDED)             Shared library: [libopenjp2.so.7]

Not sure if related, but trying to open the following JP2 image will
show an empty white rectangle in WebKitGTK/WPE (again, GIMP opens it
just fine):

  https://github.com/openpreserve/format-corpus/blob/master/jp2k-formats/balloon.jp2

The same image can be found here, with JP2 files produced using different
encoders, WebKit loads them all fine except for “balloon_aware.jp2”, which
loads as transparent pixels (GIMP opens it fine):

  https://github.com/openpreserve/format-corpus/tree/master/jp2k-test/resolution

The following one seems to be decoded as completely transparent pixels as
well (and GIMP has trouble with it as well, it shows it as mostly pure green
pixels with some small black spots):

  https://www.fnordware.com/j2k/jp2samples.html
Comment 3 Andres Gomez Garcia 2022-08-30 01:20:03 PDT
Thanks for reporting this, Adrián.