Odai A. Ali
Odai A. Ali

Reputation: 1215

How to support webp format images on imagemagick running on cloud functions for firebase?

I'm getting this error whenever I try to process an image with the webp format

Failed to blur image. { Error: Command failed: composite -gravity SouthWest /tmp/AppLogo.png /tmp/funny.webp /tmp/funny.webp composite: delegate failed "dwebp" -pam "%i" -o "%o"' @ error/delegate.c/InvokeDelegate/1310. composite: unable to open image/tmp/magick-255i74iCxeR7SM': No such file or directory @ error/blob.c/OpenBlob/2712.

If I should to install the right delegates for this format how should I write firebase Command CLI to do that for me ?Please help.

AskFirebase

Upvotes: 0

Views: 1055

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317657

The ImageMagick binary provided by Cloud Functions doesn't support webp, and that's not likely to change in the near future. Consider instead providing your own compiled ImageMagick and bundle it with your functions. Or, even better, use a node module that natively supports webp, such as Sharp (which also claims to be faster than ImageMagick). There is official sample code that uses this module.

Upvotes: 2

Related Questions