[gdk-pixbuf: 1/2] gif: Honor "revert to previous" behaviour on the first frame.




commit 8a5c7cf85dc80910d993a5eeaae9b2e61677bb23
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Jan 5 11:05:29 2021 +1300

    gif: Honor "revert to previous" behaviour on the first frame.
    
    The code originally failed to load GIFs that had this set (4607c8e9) and then
    changed to silently ignoring it (af71489c).
    
    Reverting to the background on the first frame seems completely reasonable and
    is the behaviour of Firefox/Chrome. The
    [current GIF spec](https://www.w3.org/Graphics/GIF/spec-gif89a.txt) doesn't
    indicate any issue doing this and it matches what Firefox/Chrome does.
    
    Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/166

 gdk-pixbuf/io-gif.c | 8 --------
 1 file changed, 8 deletions(-)
---
diff --git a/gdk-pixbuf/io-gif.c b/gdk-pixbuf/io-gif.c
index 64a492a58..1befba155 100644
--- a/gdk-pixbuf/io-gif.c
+++ b/gdk-pixbuf/io-gif.c
@@ -623,14 +623,6 @@ gif_get_frame_info (GifContext *context)
        context->x_offset = LM_to_uint (buf[0], buf[1]);
        context->y_offset = LM_to_uint (buf[2], buf[3]);
 
-       if (context->animation->frames == NULL &&
-            context->disposal == 3) {
-                /* First frame can't have "revert to previous" as its
-                 * dispose mode. Silently use "retain" instead.
-                 */
-                context->disposal = 0;
-       }
-
        context->frame_interlace = BitSet (buf[8], INTERLACE);
 
 #ifdef DUMP_IMAGE_DETAILS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]