1

I've created an asset volume to which I can successfully upload jpgs, pngs, static webps etc. But when I try to upload an animated webp I get the alert:

Upload failed. The error message was: “The file “example.webp” does not appear to be an image.”

The file is an image and I've tried various different animated webps. It seems to just be them specifically. Weirdly, if I copy and paste the same animated webp into a redactor field it displays there and animates and saves fine. Does craft not supported animated webps as a file type or do I maybe need to change something in my config?

screen grab of error message “The file “example.webp” does not appear to be an image.”

4
  • 1
    Go to Utilities->Php Info in the control panel and search for "imagick" and "gd" and see if webp is listed in either of their supported formats. – Brad Bell May 12 at 21:26
  • @BradBell "imagick" was not there but "gd" was and it has "WebP Support: Enabled". I installed imagick just to see if that would work. Its now the default and has the php info "ImageMagick supported formats: WEBP" but unfortunately still getting the alert message: "The file “/var/www/html/storage/runtime/temp/p0ly-test-03609d97028efc87.82756094.webp” does not appear to be an image." – patrick.altair May 13 at 21:20
  • Are there any errors being logged in Craft's storage/logs folder when you upload? Maybe memory_limit or max_execution_time related? – Brad Bell May 16 at 21:20
  • I get two errors logged, neither seem to mention memory_limit or max_execution_time. One is a craft\controllers\AssetsController::actionUpload error saying the file does not appear to be an image. The second is a craft\errors\ImageException error in the logs. It reads: ImagickException: data encoding scheme is not supported `/var/www/html/storage/runtime/temp/P0LY_Test60a2e191a91de2.16978634.webp' @ error/webp.c/ReadWEBPImage/338 in /var/www/html/vendor/pixelandtonic/imagine/src/Imagick/Imagine.php:69 – patrick.altair May 17 at 21:39
1

ImagickException: data encoding scheme is not supported `/var/www/html/storage/runtime/temp/P0LY_Test60a2e191a91de2.16978634.webp' @ error/webp.c/ReadWEBPImage/338 in /var/www/html/vendor/pixelandtonic/imagine/src/Imagick/Imagine.php:69

Based on that error, it definitely seems like an Imagick bug or Imagick configuration issue.

https://github.com/ImageMagick/ImageMagick/issues/22

https://github.com/gographics/imagick/issues/181

I don't understand most of that (sounds like you might have a webp image that is using some extended features that Imagick doesn't know about), but hopefully it points you in the right direction.

1
  • Thanks Brad, I'll look through these and report back if I discover the issue! – patrick.altair May 20 at 7:51
0

To explicitly outputting a webp image:

<source type="image/webp" srcset="{{ asset.getUrl({
    transform: 'myNamedTransform',
    format: 'webp',
}) }}">
1
  • Hi Priti, I appreciate this but my problem is occurring before this when I'm trying to upload the file through craft, not outputting it on the frontend. I'll add a screengrab for context. – patrick.altair May 11 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.