You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are utilizing the AUTO_WEBP feature and anticipate all images to be converted to WebP, including GIFs while preserving their animations.
Sharp provides the capability to achieve this, but we lack the ability to use the animated flag, and it consistently remains false when using AUTO_WEBP due to the Content-Type check.
The subsequent check for 'contentType' is nearly redundant, unless your intention is to receive GIF in output, but it's a rare case, because GIF is not an optimal choice.
It's possible that this check was initially designed to use the original image's Content-Type, and convert animated GIF to animated WEBP but it currently does not achieve that purpose.
Hi @sskylar,
We've decided to include a new filter which allows for overriding the animated flag passed into Sharp. You can read more about it here. We plan to have this feature included in the next minor/major release.
Thanks for your interest in Serverless Image Handler,
Simon
Right now sharp's
animated
option is turned on automatically if contentType is GIF:serverless-image-handler/source/image-handler/image-handler.ts
Line 78 in 1826412
This should be user customizable.
Use cases:
animated: false
)animated: true
)Animated WebP files are supported by sharp (example), but this setting is preventing it from working.
Solution:
animated
to their preference (true
orfalse
).The text was updated successfully, but these errors were encountered: