]> git.eshelyaron.com Git - emacs.git/commitdiff
(Qduration) [MAC_OS]: Undo previous change.
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Wed, 10 May 2006 08:23:20 +0000 (08:23 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Wed, 10 May 2006 08:23:20 +0000 (08:23 +0000)
(syms_of_image) [MAC_OS]: Likewise.
[MAC_OS] (gif_load): Emulate Graphic Control Extension block.

src/image.c

index 37c3bd482094164a15450638deaf9a0718c08f30..f309a401139050c7665532348759a2c77a095e8b 100644 (file)
@@ -7899,8 +7899,6 @@ gif_load (f, img)
 #else  /* !HAVE_GIF */
 
 #ifdef MAC_OS
-static Lisp_Object Qduration;
-
 static int
 gif_load (f, img)
      struct frame *f;
@@ -8067,9 +8065,21 @@ gif_load (f, img)
     DisposeHandle (dh);
 
   /* Save GIF image extension data for `image-extension-data'.
-     Format is (count IMAGES duration DURATION).  */
-  img->data.lisp_val = list4 (Qcount, make_number (nsamples), Qduration,
-                             make_float ((double)duration / time_scale));
+     Format is (count IMAGES 0xf9 GRAPHIC_CONTROL_EXTENSION_BLOCK).  */
+  {
+    unsigned char gce[4];
+    int centisec = ((float)duration / time_scale) * 100.0f + 0.5f;
+
+    /* Fill the delay time field.  */
+    gce[1] = centisec & 0xff;
+    gce[2] = (centisec >> 8) & 0xff;
+    /* We don't know about other fields.  */
+    gce[0] = gce[3] = 0;
+
+    img->data.lisp_val = list4 (Qcount, make_number (nsamples),
+                               make_number (0xf9),
+                               make_unibyte_string (gce, 4));
+  }
 
   /* Maybe fill in the background field while we have ximg handy. */
   if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
@@ -8626,11 +8636,6 @@ non-numeric, there is no explicit limit on the size of images.  */);
   ADD_IMAGE_TYPE(Qgif);
 #endif
 
-#ifdef MAC_OS
-  Qduration = intern ("duration");
-  staticpro (&Qduration);
-#endif
-
 #if defined (HAVE_PNG) || defined (MAC_OS)
   Qpng = intern ("png");
   staticpro (&Qpng);