emacs-devel
[Top][All Lists]
Advanced

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

Re: GDI+ take 3


From: Juan José García-Ripoll
Subject: Re: GDI+ take 3
Date: Sun, 19 Apr 2020 22:28:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)

Eli Zaretskii <address@hidden> writes:
> I pushed the changes to load GDI+ functions correctly.  Now everything
> works for me like Juanma reported, including multi-page GIF and TIFF
> images.  Please test again that I didn't break anything in the 64-bit
> builds.

Two minor changes attached. First, the introduction of the Qnative_image
type makes one call to image_can_use_native_api irrelevant.

Regarding this, I think it is a bad idea to introduce Qnative_image,
because that is not an image format and users cannot recognize the
actual image type from the image descriptor.

The second fix makes w32image.c behave like nsimage.c, in that a delay=0
is regarded as non-existant, thus returning nil. This makes animations
default to the minimum animation delay, which currently is 0.01, and
more useful than a delay of 0.

-- 
Juan José García Ripoll
http://juanjose.garciaripoll.com
http://quinfog.hbar.es
diff --git a/src/image.c b/src/image.c
index ffe2f607e5..c5835a0623 100644
--- a/src/image.c
+++ b/src/image.c
@@ -10182,11 +10182,6 @@ initialize_image_type (struct image_type const *type)
 #ifdef WINDOWSNT
   Lisp_Object typesym = builtin_lisp_symbol (type->type);

-# if HAVE_NATIVE_IMAGE_API
-  if (image_can_use_native_api (typesym))
-    return true;
-# endif
-
   Lisp_Object tested = Fassq (typesym, Vlibrary_cache);
   /* If we failed to load the library before, don't try again.  */
   if (CONSP (tested))
diff --git a/src/w32image.c b/src/w32image.c
index 085a5db3ab..11d96a123e 100644
--- a/src/w32image.c
+++ b/src/w32image.c
@@ -444,7 +444,8 @@ w32_load_image (struct frame *f, struct image *img,
         {
           if (nframes > 1)
             metadata = Fcons (Qcount, Fcons (make_fixnum (nframes), metadata));
-          if (delay >= 0)
+          /* We follow nsimage.c: if the delay is zero, return nil.  */
+          if (delay > 0)
             metadata = Fcons (Qdelay, Fcons (make_float (delay), metadata));
         }
       else if (status == Win32Error) /* FIXME! */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]