lagrange icon indicating copy to clipboard operation
lagrange copied to clipboard

Animated GIFs

Open skyjake opened this issue 4 years ago • 5 comments

The inline image viewer can load GIF images, but animated ones need additional work. Fortunately in v1.2, media handling was generalized a bit so a new type of media player could be added for animated images.

Here's a helpful reference: https://gist.github.com/urraka/685d9a6340b26b830d49

skyjake avatar Feb 27 '21 12:02 skyjake

@skyjake

You mean only animated GIFs and not animated PNGs (APNGs) like this one?

Lagrange 1 2 1 - 2021-02-27 - 009

For me PNG format is far superior to GIF format and support for animated PNGs would be great.

smaragdus avatar Feb 27 '21 19:02 smaragdus

Yeah for now only GIFs, since stb_image is doing the heavy lifting here.

APNG is interesting, but I expect it to require writing more code to extract the animation information and additional frames from the PNG chunks.

skyjake avatar Feb 27 '21 20:02 skyjake

@skyjake There is a patch for APNG support in stb_image.h, can't you use it?

niutech avatar Sep 20 '21 14:09 niutech

I likely could use that, but I'd rather stick to the unmodified stb_image.h from the main nothings repository, as there is no guarantee this patch will be updated whenever the main stb_image.h is updated.

I see this as quite a low priority feature. On the whole, I'd rather invest my time into better external viewer integration (#135).

skyjake avatar Sep 21 '21 11:09 skyjake

+1 for simple Animated GIF support, though I get not wanting to add more code in.

Perhaps a nice compromise would be to add text to the mime-type/sizing that says if the GIF is animated, so a reader knows to download it and view it with an external program? Looks like it would fit nicely here:

image

acidus99 avatar Jan 21 '23 19:01 acidus99