Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

imagick not converting webp format on Amazon Linux

imagick convert command is not working for this webp image -
https://lh3.googleusercontent.com/VRY0O_3L8VH2wxJSTiKPr72PeM5uhPPFEsHzzYdxenddpTI150M0TYpljnZisQaROR0=h256-rw -

convert -resize 50x50! https://lh3.googleusercontent.com/VRY0O_3L8VH2wxJSTiKPr72PeM5uhPPFEsHzzYdxenddpTI150M0TYpljnZisQaROR0=h256-rw /var/test_sandeepan/output.jpg

Output -

convert: no decode delegate for this image format `WEBP' @ error/constitute.c/ReadImage/535.

From this, I conclude that webp is either not supported by Imagick at all, or not supported by this version.

A link shared in this answer, talks about webp support along with imagemagick and php, so I thought imagick must be supporting webp as well, because PHP imagemagick, as per my understanding is nothing but a wrapper class to the imagick utility. Please correct me if I am wrong here.

like image 571
Sandeepan Nath Avatar asked Jun 03 '26 05:06

Sandeepan Nath


1 Answers

I conclude that webp is either not supported by Imagick at all, or not supported by this version.

Imagick doesn't really do anything. All it does is convert PHP function calls into C function calls, to call the ImageMagick code through its 'wand' API.

If you want to have ImageMagick support webp, you will either need to install a version that has been compiled with webp support compiled in, or compile it yourself: http://www.imagemagick.org/script/advanced-unix-installation.php

You'll need to install libwebp-devel either from apt/yum, or from https://github.com/webmproject/libwebp as ImageMagick relies on that 'delegate' code being there to read/write webp images.

like image 88
Danack Avatar answered Jun 05 '26 01:06

Danack



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!