]> git.eshelyaron.com Git - emacs.git/commitdiff
(png_load): Make sure SPECIFIED_BG is a string.
authorMiles Bader <miles@gnu.org>
Thu, 25 Oct 2001 00:53:48 +0000 (00:53 +0000)
committerMiles Bader <miles@gnu.org>
Thu, 25 Oct 2001 00:53:48 +0000 (00:53 +0000)
(png_load): BG is a pointer to a structure, not a structure.
(gif_format, png_format): Add missing commas.

src/xfns.c

index ebe63d1edd9bfd10bb6ef3cdf4c822c050207d69..9773344c898289ae14841ef37f230e4c79a1d64d 100644 (file)
@@ -8615,7 +8615,7 @@ static struct image_keyword png_format[PNG_LAST] =
   {":relief",          IMAGE_INTEGER_VALUE,                    0},
   {":conversion",      IMAGE_DONT_CHECK_VALUE_TYPE,            0},
   {":heuristic-mask",  IMAGE_DONT_CHECK_VALUE_TYPE,            0},
-  {":mask",            IMAGE_DONT_CHECK_VALUE_TYPE,            0}
+  {":mask",            IMAGE_DONT_CHECK_VALUE_TYPE,            0},
   {":background",      IMAGE_STRING_OR_NIL_VALUE,              0}
 };
 
@@ -8891,11 +8891,11 @@ png_load (f, img)
       Lisp_Object specified_bg
        = image_spec_value (img->spec, QCbackground, NULL);
 
-      if (! NILP (specified_bg))
+      if (STRINGP (specified_bg))
        /* The user specified `:background', use that.  */
        {
          XColor color;
-         if (x_defined_color (f, specified_bg, &color, 0))
+         if (x_defined_color (f, XSTRING (specified_bg)->data, &color, 0))
            {
              png_color_16 user_bg;
 
@@ -9031,7 +9031,7 @@ png_load (f, img)
       png_color_16 *bg;
       if (png_get_bKGD (png_ptr, info_ptr, &bg))
        {
-         img->background = lookup_rgb_color (f, bg.red, bg.green, bg.blue);
+         img->background = lookup_rgb_color (f, bg->red, bg->green, bg->blue);
          img->background_valid = 1;
        }
     }
@@ -9854,7 +9854,7 @@ static struct image_keyword gif_format[GIF_LAST] =
   {":conversion",      IMAGE_DONT_CHECK_VALUE_TYPE,            0},
   {":heuristic-mask",  IMAGE_DONT_CHECK_VALUE_TYPE,            0},
   {":mask",            IMAGE_DONT_CHECK_VALUE_TYPE,            0},
-  {":image",           IMAGE_NON_NEGATIVE_INTEGER_VALUE,       0}
+  {":image",           IMAGE_NON_NEGATIVE_INTEGER_VALUE,       0},
   {":background",      IMAGE_STRING_OR_NIL_VALUE,              0}
 };