Bug 181421

Summary: [GTK] Problem with Washington Post images
Product: WebKit Reporter: bugzilla-ok
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major CC: bugs-noreply, cgarcia, clopez, mcatanzaro
Priority: P2    
Version: Other   
Hardware: All   
OS: Linux   
Attachments:
Description Flags
Patch clopez: review+

Description bugzilla-ok 2018-01-08 17:30:59 PST
Many images on Washington Post fail to load. For example (article chosen at random):

https://www.washingtonpost.com/news/politics/wp/2018/01/05/trumps-first-year-jobs-numbers-were-very-very-good/?utm_term=.1c86a459b14a

Problem is with latest versions of Epiphany, Surf and MiniBrowser (under Xubuntu 17.10). Works fine with Firefox.
Comment 1 Carlos Garcia Campos 2018-02-01 05:39:48 PST
This is because Washington Post is using the user agent to decide the image formats it serves. In the case of chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and it's providing jp2 images that we don't support. So, we would need a user agent quirk to pretend to be firefox or chromium (I guess better chromium in this case) or add an image decoder for jpeg 2000.
Comment 2 Carlos Garcia Campos 2018-02-01 05:51:10 PST
Created attachment 332869 [details]
Patch

This is the easiest solution in the short-medium term.
Comment 3 Carlos Alberto Lopez Perez 2018-02-01 06:07:44 PST
Mmmm, good catch.

And I'm checking that people is actually recommending do this to webmasters: parse the user-agent string to guess if JP2 support is available "because Safari doesn't expose support for it on the accept-header" https://blog.elijaa.org/2016/01/29/detect-webp-jpeg2000-jpegxr-image-format-support-in-php/

So we may be bitten by this on more sites than on Washington post :(
Comment 4 Carlos Garcia Campos 2018-02-01 06:11:37 PST
(In reply to Carlos Alberto Lopez Perez from comment #3)
> Mmmm, good catch.
> 
> And I'm checking that people is actually recommending do this to webmasters:
> parse the user-agent string to guess if JP2 support is available "because
> Safari doesn't expose support for it on the accept-header"
> https://blog.elijaa.org/2016/01/29/detect-webp-jpeg2000-jpegxr-image-format-
> support-in-php/
> 
> So we may be bitten by this on more sites than on Washington post :(

That's why I think adding support for jpeg2000 could be the long term solution.
Comment 5 Carlos Garcia Campos 2018-02-01 07:55:24 PST
Committed r227965: <https://trac.webkit.org/changeset/227965>