skyjake/lagrange Issue #183: Animated GIFs

Repo Home
Issues

2021-02-27 12:22:52 skyjake

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

Comments (5)

2021-02-27 19:24:46 smaragdus

@skyjake

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

![Lagrange 1 2 1 - 2021-02-27 - 009](https://user-images.githubusercontent.com/9025757/109397882-dfd44e00-7941-11eb-9559-1103475aed93.png)

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

2021-02-27 20:27:50 skyjake

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.

2021-09-20 14:42:03 niutech

@skyjake There is a [patch for APNG support](https://github.com/jcredmond/stb/commit/71e7e527eedc27f2b9f29fe9fe3991fc6fb24212) in stb_image.h, can't you use it?

2021-09-21 11:04:20 skyjake

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).

2023-01-21 19:33:17 acidus99

+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:

<img width="683" alt="image" src="https://user-images.githubusercontent.com/4118560/213884040-2562dcbb-df95-4a21-b1b5-3fcbb699a971.png">