weserv / images

Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s).
https://wsrv.nl/
BSD 3-Clause "New" or "Revised" License
2.03k stars 200 forks source link

Any chance to have support for Animated PNGs (APNGs)? #255

Open BobbyWibowo opened 4 years ago

BobbyWibowo commented 4 years ago

I personally think APNG is such an obscure/meme format, but some big players do use it, so it is what it is I suppose.

Here are some sample images: Sample

https://stickershop.line-scdn.net/stickershop/v1/sticker/72822926/iPhone/sticker@2x.png;compress=true

Sample

https://stickershop.line-scdn.net/stickershop/v1/sticker/72822927/iPhone/sticker@2x.png;compress=true

For now the service will only treat APNGs as static PNGs (so it only recognizes the first frame). It'd be great if the service allows on-the-fly conversion of APNGs to GIFs instead, and optionally make the GIFs have infinite loop. I mention loop cause those APNGs at their current state will only loop once, as is the decision from LINE themselves.

If they don't loop on your end, try opening the direct link underneath them on a new tab. GitHub proxies them into static PNGs too.

kleisauke commented 4 years ago

We are currently experimenting with switching from libpng to libspng for reading PNG files, which makes randy408/libspng#4 relevant here. Implementing this in a PR for https://github.com/randy408/libspng or making a donation to https://opencollective.com/libspng would be the best next step.