jw-12138 / vite-plugin-vsharp

Compress Images for the Web with Vite and Sharp
MIT License
43 stars 0 forks source link

[Bug] animated gifs have their animation removed #8

Closed FatehAK closed 1 year ago

FatehAK commented 1 year ago

thumbsup

When vsharp processes the above file the animation is removed. I think its related to https://github.com/lovell/sharp/issues/3258 and may require a config change in the plugin.

jw-12138 commented 1 year ago

fixed it in version 1.3.0, thanks for pointing this out!

https://github.com/jw-12138/vite-plugin-vsharp/commit/e3cd4b8af19ba4ea7196998e0460c39e425df219

FatehAK commented 1 year ago

Great! will check it out

FatehAK commented 1 year ago

Just checked seems like the file size has increased a lot from earlier for all the image files after this change. Not sure why this might happen.

Ref repo: https://github.com/FatehAK/memrise/tree/vsharp-test

jw-12138 commented 1 year ago

I've also noticed this problem during test, that's why I added a layer that if the output image size is bigger than the input, the plugin will leave the image as is. seems like people are getting the same problem with sharp.js (https://github.com/lovell/sharp/issues/2213) as we are.

I think for now there is nothing I could do, sorry. 🥲

FatehAK commented 1 year ago

Damn thought so something's up with sharp.js. Cool thanks for taking the time to check 👍