Commit graph

4 commits

Author SHA1 Message Date
Aliaksandr Kalenik
8c06273dbf LibGfx: Tolerate missing optional WebP ICC chunks
Some WebP files advertise ICC metadata in their VP8X feature flags even
though the ICCP chunk is absent or malformed. We accepted the bitstream
header and could decode the pixels, but the follow-up mux metadata
lookup failed during header decoding and made sniffing reject the image
entirely.

Treat mux and ICC metadata extraction as best-effort after libwebp
accepts the header. Images without readable optional ICC metadata now
decode normally and simply report no ICC profile.
2026-06-22 17:15:21 +02:00
Andreas Kling
61c0fb1940 LibGfx: Support incremental WebP animation decode
Instead of decoding all animation frames at once in decode_webp_image()
and caching them in frame_descriptors, decode frames one at a time
on demand. This avoids holding all decoded frames in memory at once.

The WebPAnimDecoder is kept alive across frame() calls and supports
reset for backward seeks (needed for animation looping).
2026-02-13 18:34:24 +01:00
Andreas Kling
2d811fb432 LibGfx: Add frame_duration() to ImageDecoderPlugin
Add a virtual method to query frame durations without decoding pixel
data. This is needed by the ImageDecoder service to extract timing
metadata upfront for streaming animation decode.

Implement the method for GIF, PNG, WebP, AVIF, and JPEGXL decoders.
For WebP, extract durations from the demuxer during header decode so
they are available before any frames are decoded.
2026-02-13 18:34:24 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp (Browse further)