photos icon indicating copy to clipboard operation
photos copied to clipboard

Viewer does not play animated GIFs

Open elementaryBot opened this issue 7 years ago • 6 comments

What it says above. Open an animated GIF, it does not animate.

Launchpad Details: #LP1675883 Sam Hewitt - 2017-03-24 18:10:55 +0000


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

elementaryBot avatar Apr 18 '17 17:04 elementaryBot

Will Photos App in Juno stable release support animated gifs?

mdalch avatar Aug 26 '18 09:08 mdalch

Since Videos can't play .gif files either (maybe because gif files are image files), I ask whether someone is interested in this matter and can imagine working on an implementation of .gif support in Photos.

4jNsY6fCVqZv avatar Jun 25 '20 13:06 4jNsY6fCVqZv

I guess this is because the scaled_read method in the GifReader class takes Gdk.PixBuf as a return that does only support static images:

https://github.com/elementary/photos/blob/3340506cda5082627cb60b251a4186f4d989e6a2/src/photos/GifSupport.vala#L126

Gdk.PixBufAnimation seems to support both static and animated images, but I suppose fixing this issue may require hard work because this is an overridden method and Gtk.PixBuf is used elesewhere in the source code.

ryonakano avatar Aug 05 '20 11:08 ryonakano

Thanks for looking into the code! I am also surprised that there is a GifSupport.vala but no animated Gifs.

Wouldn't it be possible that only the scaled_read method in the GifReader uses Gdk.PixBufAnimation instead of Gtk.PixBuf? Or what would be the disadvantage of switching completely to Gdk.PixBufAnimation? What are the advantages of using Gtk.PixBuf exclusively so far?

4jNsY6fCVqZv avatar Aug 05 '20 13:08 4jNsY6fCVqZv

Wouldn't it be possible that only the scaled_read method in the GifReader uses Gdk.PixBufAnimation instead of Gtk.PixBuf?

It's not possible because the scaled_read method is an overridden method of scaled_read method in GdkReader class. Overridden methods need to have the same name, arguments, and return. So if we want to change the return type of scaled_read method in the GifReader, we also need to change the return type of scaled_read method in the GdkReader class and all classes that inherit this class.

Gdk.PixBufAnimation and Gtk.PixBuf seem to be completely different classes and they don&t have the same base class. However, both can be created a new instance with GLib.InputStream, so this might help us.

I tried installing Eye of GNOME and it seem to support animated GIF using Gdk.PixBufAnimation. I'll check how it handle this problem.

ryonakano avatar Aug 11 '20 12:08 ryonakano

Please don't let this issue die..

ftphikari avatar Mar 20 '23 15:03 ftphikari