Open neil3000 opened 1 year ago
Seems like there's activity in the related imagetools
PR, so let's wait for that to land first.
I think this PR has become inactive again (for 40 days?) :/
Moreover I think it's easier to just add the {animated: true}. Indeed in the PR I proposed a parameter option because it could generate animated images for formats such as PDFs (when the dev could have just wanted a static image of the first page), which I believe is more an edge-case than animated images as a whole :)
Just thinking out loud - are animated images supposed to work with LQIP? If yes, how does it look like?
I think it could stay the way it is, that is generating a lower quality image of the first frame of the animated image?
That way it would be similar to how videos work, showing a preview image. Then once it loads, it shows the animated image.
Could it be possible to add support for animations, maybe by adding another url param, like
?anim
?Sharp already provides a way to make the conversion from animated to GIF to animated WebP, and currently the conversion technically works but returns a static image.
Sharp has this option to allow such conversion:
You could also switch to a branch of
imagetools
that supports this parameter, such as: https://github.com/JonasKruckenberg/imagetools/pull/454