]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve DISPOSE_PREVIOUS in gif_load slightly
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 12 Apr 2022 14:22:27 +0000 (16:22 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 12 Apr 2022 14:22:38 +0000 (16:22 +0200)
* src/image.c (gif_load): Tweak how DISPOSE_PREVIOUS is handled.
It's still not right, but it's less glaringly wrong.

src/image.c

index 530819eab9d7c0f6f55f6b28dbab72a7328377cd..45de7ae83d37abf050157ae260aa4e0ec12fa257 100644 (file)
@@ -9115,6 +9115,14 @@ gif_load (struct frame *f, struct image *img)
       if (disposal == DISPOSAL_UNSPECIFIED)
        disposal = DISPOSE_DO_NOT;
 
+      /* This is not quite correct -- the specification is unclear,
+        but I think we're supposed to restore to the frame before the
+        previous frame?  And we don't have that data at this point.
+        But DISPOSE_DO_NOT is less wrong than substituting the
+        background, so do that for now.  */
+      if (disposal == DISPOSE_PREVIOUS)
+       disposal = DISPOSE_DO_NOT;
+
       gif_color_map = subimage->ImageDesc.ColorMap;
       if (!gif_color_map)
        gif_color_map = gif->SColorMap;