After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768057 - Support animated images
Support animated images
Status: RESOLVED FIXED
Product: sushi
Classification: Core
Component: viewers
3.20.x
Other Linux
: Normal enhancement
: ---
Assigned To: Sushi maintainer(s)
Sushi maintainer(s)
: 710842 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-06-26 09:06 UTC by Princeton Ferro
Modified: 2018-01-21 17:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to support animated images in Sushi (3.25 KB, patch)
2016-06-26 09:06 UTC, Princeton Ferro
none Details | Review
Updated patch fixing GIF rendering. (3.01 KB, patch)
2017-07-31 17:15 UTC, Princeton Ferro
none Details | Review
Updated patch fixing GIF rendering. (2.83 KB, patch)
2017-08-01 12:22 UTC, Princeton Ferro
committed Details | Review

Description Princeton Ferro 2016-06-26 09:06:18 UTC
Created attachment 330388 [details] [review]
Patch to support animated images in Sushi

Here is a patch that adds support for animated images to Sushi.
Comment 1 Cosimo Cecchi 2017-07-31 11:15:34 UTC
Review of attachment 330388 [details] [review]:

Thanks, this looks mostly good. Just a few comments below.

::: src/js/viewers/image.js
@@ +130,3 @@
+
+    destroy : function () {
+        this._ending = true;

I don't think you need this private state, since you remove the mainloop source below -- so there should not be a case where the timeout callback is called after destroy() is called.

@@ +138,3 @@
+
+    _onTimeoutCompleted : function() {
+            Mainloop.source_remove(this._timeoutId);

Isn't this guaranteed to be non-zero at this point?

@@ +143,3 @@
+            this._texture.set_from_pixbuf(pix);
+            this._timeoutId = 0;
+    },

You can return true instead of manually restarting the timeout to re-schedule it again with the same parameters.
Comment 2 Princeton Ferro 2017-07-31 17:15:39 UTC
Created attachment 356665 [details] [review]
Updated patch fixing GIF rendering.

Okay. Here's an updated patch taking into account your comments.
Comment 3 Cosimo Cecchi 2017-08-01 09:25:01 UTC
Review of attachment 356665 [details] [review]:

Thanks, some more minor comments... getting there.

::: src/js/viewers/image.js
@@ +44,3 @@
         this.moveOnClick = true;
         this.canFullScreen = true;
+        this._ending = false;

This field is unused, so could be removed.

@@ +137,3 @@
+
+    _advanceImage : function () {
+            this._timeoutId = 0;

I don't think this will ever be called without this._timeoutId being set, so you could remove the check (unless I'm missing something).
Comment 4 Princeton Ferro 2017-08-01 12:22:46 UTC
Created attachment 356720 [details] [review]
Updated patch fixing GIF rendering.

Okay. I have removed all unnecessary checks and the use of the _ending flag.
Comment 5 Cosimo Cecchi 2017-08-02 09:41:04 UTC
Review of attachment 356720 [details] [review]:

Thanks! Looks good to me now. Do you have a GNOME git account? If not, I will push the patch for you.
Comment 6 Princeton Ferro 2017-08-02 12:13:04 UTC
(In reply to Cosimo Cecchi from comment #5)
> Review of attachment 356720 [details] [review] [review]:
> 
> Thanks! Looks good to me now. Do you have a GNOME git account? If not, I
> will push the patch for you.

I don't have a GNOME git account.
Comment 7 Cosimo Cecchi 2017-08-02 13:07:59 UTC
Thanks again, I pushed this to master now.
Comment 8 Frank Dana 2018-01-21 13:09:21 UTC
I notice sushi didn't get a 3.26 release, will there be a sushi-3.28 release in March which includes this fix? Fedora, at least, is still on sushi-3.24.0 which does not animate GIF previews, so it'd be great to get it out there.
Comment 9 Piotr Drąg 2018-01-21 17:48:04 UTC
*** Bug 710842 has been marked as a duplicate of this bug. ***