From: Lars Ingebrigtsen Date: Tue, 12 Apr 2022 14:22:27 +0000 (+0200) Subject: Improve DISPOSE_PREVIOUS in gif_load slightly X-Git-Tag: emacs-29.0.90~1931^2~626 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a987e66e6ba014795ba4540c5fedeb9894bdd94e;p=emacs.git Improve DISPOSE_PREVIOUS in gif_load slightly * src/image.c (gif_load): Tweak how DISPOSE_PREVIOUS is handled. It's still not right, but it's less glaringly wrong. --- diff --git a/src/image.c b/src/image.c index 530819eab9d..45de7ae83d3 100644 --- a/src/image.c +++ b/src/image.c @@ -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;