Add next/image docs section for animated images#35123
Conversation
styfle
commented
Mar 7, 2022
- Related to Image component change animated files to static ones #34807
|
|
||
| The default [loader](#loader) will automatically bypass Image Optimization for animated images and serve it as-is, since converting all the frames of an animated image on-demand is too slow. | ||
|
|
||
| Auto-detection for animated files is best-effort and supports GIF, APNG, and WebP. If you want to explicitly bypass Image Optimization for a given animated image, use the [unoptimized](#unoptimized) prop. |
There was a problem hiding this comment.
What does best effort mean here? Does it look at the file extension? How would it fail?
There was a problem hiding this comment.
The buffer is analyzed using is-animated package which returns true/false. If it returns true, then we bypass. If it returns false, then we optimize the image.
There was a problem hiding this comment.
This is interesting, i didnt know that we dont optimize animated images. So a site with lots of GIFs wont benefit from our optimizations
There was a problem hiding this comment.
In most cases, animated images are not source images. Instead, they are typically exported from some other source such as a video. Most tools that export to animated gif offer a compression option so theres very few cases where a user would even want to optimize an animated image anyway (so far no one has requested it).
Co-authored-by: Lee Robinson <me@leerob.io>