vite-plugin-image-optimizer icon indicating copy to clipboard operation
vite-plugin-image-optimizer copied to clipboard

Animated webp images are not animated after optimization

Open dawidkowalik opened this issue 1 year ago • 1 comments

Hello, I've noticed that I can't use the plugin with webp animations.

https://github.com/FatehAK/vite-plugin-image-optimizer/blame/a281c44fd2d18dd91d2c093704833b5592fb86f4/src/index.ts#L104 return await sharp(buffer, { animated: extName === 'gif' })

I guess it's related to this condition. Is it something that can be fixed?

Thank you!

dawidkowalik avatar Jun 12 '24 19:06 dawidkowalik

In addition, except webp images, apng images are also not supported. Although the sharp library does not support apng image format yet, it is better to also include "png" and "apng" extensions here as well.

otomad avatar Nov 07 '24 07:11 otomad