Skip to content

Invalid Chunk headers with WebP image format #1923

Open
@ghost

Description

Bug Report

Environment

  • Zola version: next branch, commit 39cf436
  • GIMP version: v2.99.9 commit bb4403fd49
  • ImageMagick version: v7.1.0-43

Description

Hello,

I encountered an issue similar to #1904 and tried to investigate its cause.

I was trying to resize a WebP image (webp -> webp) with resize_image and got the following error message:

Reason: `resize_image`: Failed to read image: <image path>

In an attempt to find the root cause, I ran the unit tests on zola/components/imageproc using cargo test, which executed successfully. Then, I replaced the webp.webp file in the test_imgs folder with my webp file. The assertion failed (which is normal), though I got an unexpected error:

0: Format error decoding WebP: Invalid Chunk header: [0x30, 0x2C, 0x05, 0x9D]
1: Invalid Chunk header: [0x30, 0x2C, 0x05, 0x9D]', components/imageproc/tests/resize_image.rs:43:87

I supposed that my webp file was wrong somehow. I made my webp image with GIMP, also tried with ImageMagick’s convert from PNG and got the same result (aren’t they using the same lib?). They seem to include specific image headers that zola/imageproc does not recognize properly.

Here are the export options I used when saving my webp with GIMP:
Options when exporting the image

To make it work with zola/imageproc, I had to uncheck all those boxes when exporting, like this:
Options when exporting the image, all boxes unchecked

Then, the header was properly recognized and resize_image could process my file as expected.

It seems to be a parsing issue, though I can’t tell if it’s an upstream issue or not.

Find both files (valid and invalid webp) below − couldn’t upload them to GitHub since they don’t support webp, I suppose it’s too « recent », huh.

To reproduce, replace the « invalid » webp with the webp.webp file in the aforementioned directory and execute cargo test, or try to use resize_image with it.

Anyway, hoping that zola will support AVIF format soon :)

EDIT: After some searches, there seem to be an upstream issue for this. image/image#1712
I guess there’s nothing we can do to fix it in Zola, feel free to close then.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions