Repository navigation
WebP images through a pinned libwebp 1.6.0, to Pillow's pixels - #1004
Conversation
…Pillow 13.0.0's), to Pillow's RGB bytes, EXIF-oriented, alpha over white; animated WebP refused as animated pictures are
cwschroeder
left a comment
There was a problem hiding this comment.
Reviewed the single commit cf989a39; no material source issue found in the WebP loader, RIFF bounds, allocation cleanup, orientation/alpha finishing or format wiring.
With the existing pinned libwebp 1.6.0, the actual picture tests pass 16/16 in both Zig 0.17.0 Debug and Fast, including all eight WebP fixture outcomes. Additional CPU controls and receipts pass for a missing library, a synthetic wrong version and missing symbols; both Zig output-allocation failure points; 12,582 prefix cuts and 24 RIFF-size changes with six full positive controls. No trap or allocator leak was observed. Whole-tree formatting and patch whitespace pass; all four current-head CI checks are green.
Coverage limits: JPEG pixel subcases were excluded because the local JPEG library differs from its separate pin. The WebP pixels match the submitted Pillow 13 fixture table; I did not rebuild an independent Pillow 13 oracle or rerun the author-reported served vision/model checks. No Metal/model execution or repository changes here.
|
Thank you, @BobClawblaw, for WebP support and the lossless/lossy, alpha and orientation fixtures. We merged your work for 1.1.0 in 6e1ca30, through the existing picture API, processors and towers. libwebp 1.6.0 is an optional, version-checked runtime load; TensorFold ships no copy and refuses WebP clearly when the decoder is unavailable or incompatible. Host decoder/refusal checks passed; a final libwebp 1.6.0 image/alpha/EXIF device-fixture run is not separately recorded. Posted by Ash's AI Assistant Synthena |
run.sh's JPEG warning and prepare.sh's comment said PNG and WebP serve without libturbojpeg. Upstream 1.0.12's docs/vision.md refuses WebP by name, and 1.1.0 decodes it only through libwebp 1.6.0's libwebpdecoder, which the release archive does not ship (upstream CHANGELOG, ashhart#1004). The warning now names PNG alone, and a comment says why WebP is out. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qj4LeSvZn6iJnKY4dqjKJ8
…oaded at run time, on the shared picture decoder docs/vision.md took both sides: ashhart#1004's WebP paragraph after the JPEG one, and this line's sizing sentence, which names Gemma 4's processor beside GLM5-Next's.
WebP images now decode, so every vision family on the shared picture decoder serves them: the Qwen-VL tower (Qwen3.8-27B, Flash Next), GLM, Nemotron's RADIO and LFM2. Until now the server refused them by name.
What changes
core/picture/webp.zigloads one pinned libwebp decoder, 1.6.0 (libwebpdecoder, the release Pillow 13.0.0 bundles), at the first WebP. It is found and refused the wayjpeg.zigfinds libturbojpeg:TENSORFOLD_LIBWEBPnames, thenlib/beside the server's folder, beside the server, Homebrew'swebp, then the loader's path;WebPGetDecoderVersion), and so is a missing library.WebPDecodeRGBAInto, and core'sfinish: EXIF-oriented, alpha over white, as PNG and JPEG.server/images.zig) admits WebP. Refusals now name PNG, JPEG or WebP.picture.problemloses its unusedbytesparameter.zig/tests/fixtures/picture/webp.json, fromtools/zig/picture_webp_fixtures.py, holds eight files and the RGB bytes Pillow 13.0.0 gives them: lossy, lossless, both with alpha, 1x1, an EXIF orientation 6, an animated file and a cut one.tools/zig/vision_served.pychecks that a WebP answers, that a lossless WebP named after a PNG gives that PNG's reply, and that a damaged WebP is refused.docs/vision.md,THIRD_PARTY_NOTICES.md(libwebp, BSD-3-Clause).Checks (M5 Ultra):
--vision --vision-urls, the same commit stacked on Flash Next: images and video on native Metal, and warm passes that keep nothing skipped (stacked on #606) #986):vision_served.pypasses. A Pillow q75 WebP photo answers, a lossless WebP gives its PNG's reply, and a damaged WebP and a GIF are refused.--vision-urls.https://www.gstatic.com/webp/gallery/1.webp) is described correctly.zig build testwith the library and without it,test-kernel-contract,test-golden,fuzz-cortheon,zig fmt --checkand the lean check (no new problems against main) pass.