Open EnderPicture opened 2 years ago
Your link seems to just go to their homepage and I couldn't find the specific option you mentioned.
Maybe you can provide a quick reproduction with a gif that would be converted into an animated webp normally but doesn't get converted when using imagetools so I can can check it out!
I think he's referring to options.pages
.
number of pages to extract for multi-page input (GIF, WebP, AVIF, TIFF, PDF), use -1 for all pages.
Sorry for the delay, I was referring to this section
// Convert an animated GIF to an animated WebP
await sharp('in.gif', { animated: true }).toFile('out.webp');
From the constructor page of Sharp website, there are 2 references to animated file in the options
options.pages
number number of pages to extract for multi-page input (GIF, WebP, AVIF, TIFF, PDF), use -1
for all pages. (optional, default 1
)options.animated
boolean Set to true
to read all frames/pages of an animated image (equivalent of setting pages
to -1
). (optional, default false
)Would be great to have an option for webp animated or not in imagetools.
Any plans to implements this?
I guess line 6
in util.ts
has to be extended to receive the option to enable animations:
return sharp(path, { animated: true })
Hi,
I see that it is possible for Sharp to convert Gif to animated Webp files in their doc. Is it possible in image tools? currently, the conversion works but only to a static image.
Thanks!