ERROR 9516 When resizing webp image in worker

I use the following code to resize image

addEventListener('fetch', function (event) {
    event.respondWith(handleRequest(event.request))
});


async function handleRequest(request) {
    let options = {
        cacheEverything: true,
        cf: {
            image: {
                width: 100,
                height: 100
            }
        }
    }
    let url = "https://resizer.neuraloom.dev/media/backgrounds/defaults/video/previews/water-waves-cycled.webp"
    return fetch(url, options)
}

And get this error message

ERROR 9516: Could not resize the image: error during decoding: Error while decoding WebP image. The file may be incomplete or damaged

While webp image look valid!
Is this probably a Cloudflare bug?

Thank you for reaching us.

I’m able to reproduce the issue. It is not only related to worker, bur to webp decoding in general.
I’ll let you know the outcome of investigation.

1 Like

This topic was automatically closed after 15 days. New replies are no longer allowed.

Sorry for the unclear error message. It’s trying to say that it’s not a WebP image, but a WebP animation. We don’t have support for reading WebP animations. We can make them (from GIF), but we can’t read them.

1 Like