On Mon, 17 Mar 2025 13:46:06 GMT, Jose Pereda <jper...@openjdk.org> wrote:

>> Issue: Some images don't load with WebKit 620.1
>> 
>> WebKit Image Decoding Failure Due to Unintended WebP Format Delivery
>> WebKit encounters image decoding failures when certain servers respond with 
>> WebP images instead of the intended JPEG or PNG format. This issue arises 
>> due to WebKit's Accept header configuration, which prioritises WebP by 
>> default. Consequently, incomplete or malformed WebP data results in decoding 
>> errors.
>> 
>> Solution:
>> Keep the image rendering features and supported formats as webkit 619.1 , 
>> and accordingly
>> update the Accept header to prioritize JPEG/PNG over WebP unless WebP 
>> decoding is confirmed stable.
>
> modules/javafx.web/src/main/native/Source/WebCore/loader/cache/CachedResourceRequest.cpp
>  line 151:
> 
>> 149:         StringBuilder builder;
>> 150: // Java platform failing to decode webp image data already disabled in 
>> 619.1
>> 151: #if (HAVE(WEBP) || USE(WEBP)) && !PLATFORM(JAVA)
> 
> I see that 619.1 indeed had:
> 
> #if HAVE(WEBP) || USE(WEBP)
>          builder.append("image/webp,"_s);
> #endif
> 
> I wonder why the condition `!PLATFORM(JAVA)` is also required now?

Likely those two flags are now defined (in 620.1), but weren't defined in 
619.1. It is therefore safer to add the `!PLATFORM(JAVA)` and in any case any 
time we modify code from upstream, we should qualify it with a `PLATFORM(JAVA)` 
check.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1738#discussion_r1998974216

Reply via email to