-
Notifications
You must be signed in to change notification settings - Fork 66
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
Auto-detect animated sources #53
Comments
Hi @ascorbic. I think the limitation is that we cannot resize webp animated output. (context #35 and lovell/sharp#2275). So usage should be with caution. |
Ooh, that makes sense. Hmm. I guess I'll need to work out a way to pass the |
...though thinking about it, if we can't resize them, then there's not much point using next/image |
Indeed. What do you think about supporting a no-op modifier that returns source image? (can be auto enabled for |
Yes, we do that for svg and gif but it could be a useful addition. I'm also going to think of a syntax that can be used in next/image source URLs that will allow modifiers to be passed-through |
If |
That would be a nice feature to avoid the wrong usage of the experimental |
Hello, if you hadn't seen we're currently working on both improving animated image resizing and adding GIF write support to sharp. |
@lovell That's great! Will GIF write support be in the precompiled binaries? |
That's good news! What sort of timeline is there for these two? |
If you hadn't already seen, support for resizing and cropping animated GIF and WebP images was added in sharp v0.30.0. https://sharp.pixelplumbing.com/changelog const data = await sharp('in.gif', { animated: true })
.resize({ width: 128, height: 128 })
.toBuffer() |
Let's enable animated by default then! @lovell I've enabled it only for |
When returning image metadata after Sharp has processed an animated gif, I'm getting the entire 'toilet paper roll' height instead of the individual height of the pages.
@lovell |
Solved my issue with the following.
|
Thanks for the notice @tgcallaway. Are you also facing the same problem with IPX? (FYI we use image-meta but mainly to find mime type.) |
@pi0 Always passing
@tgcallaway Not directly at the moment. Adding |
Currently, if you want animated output you need to specifically choose it. It would be good if animated webp input images could automatically generate animated output. I'm not sure what the overhead would be of just passing
animated
to the sharp constructor every time.The text was updated successfully, but these errors were encountered: