Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable animations for GIF files #12

Open
neil3000 opened this issue Apr 16, 2023 · 4 comments
Open

Enable animations for GIF files #12

neil3000 opened this issue Apr 16, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@neil3000
Copy link

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:

return sharp(path, { animated: true })

You could also switch to a branch of imagetools that supports this parameter, such as:
JonasKruckenberg/imagetools#454

@zerodevx
Copy link
Owner

Seems like there's activity in the related imagetools PR, so let's wait for that to land first.

@neil3000
Copy link
Author

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 :)

@zerodevx
Copy link
Owner

zerodevx commented Jun 2, 2023

Just thinking out loud - are animated images supposed to work with LQIP? If yes, how does it look like?

@neil3000
Copy link
Author

neil3000 commented Jun 2, 2023

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.

@zerodevx zerodevx added the enhancement New feature or request label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants