aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/image.c b/src/image.c
index 0d52399327e..a6b3c8f19c5 100644
--- a/src/image.c
+++ b/src/image.c
@@ -201,7 +201,7 @@ XPutPixel (ximage, x, y, pixel)
201 } 201 }
202 else 202 else
203#endif 203#endif
204 if (depth == 1) 204 if (depth == 1)
205 { 205 {
206 char *base_addr = GetPixBaseAddr (pixmap); 206 char *base_addr = GetPixBaseAddr (pixmap);
207 short row_bytes = GetPixRowBytes (pixmap); 207 short row_bytes = GetPixRowBytes (pixmap);
@@ -444,8 +444,6 @@ x_create_bitmap_from_data (f, bits, width, height)
444 id = x_allocate_bitmap_record (f); 444 id = x_allocate_bitmap_record (f);
445#ifdef MAC_OS 445#ifdef MAC_OS
446 dpyinfo->bitmaps[id - 1].bitmap_data = (char *) xmalloc (height * width); 446 dpyinfo->bitmaps[id - 1].bitmap_data = (char *) xmalloc (height * width);
447 if (! dpyinfo->bitmaps[id - 1].bitmap_data)
448 return -1;
449 bcopy (bits, dpyinfo->bitmaps[id - 1].bitmap_data, height * width); 447 bcopy (bits, dpyinfo->bitmaps[id - 1].bitmap_data, height * width);
450#endif /* MAC_OS */ 448#endif /* MAC_OS */
451 449
@@ -4381,7 +4379,7 @@ xpm_load_image (f, img, contents, end)
4381 if (color == NULL) 4379 if (color == NULL)
4382 goto failure; 4380 goto failure;
4383 4381
4384 while (str = strtok (NULL, " \t")) 4382 while ((str = strtok (NULL, " \t")) != NULL)
4385 { 4383 {
4386 next_key = xpm_str_to_color_key (str); 4384 next_key = xpm_str_to_color_key (str);
4387 if (next_key >= 0) 4385 if (next_key >= 0)
@@ -4409,17 +4407,21 @@ xpm_load_image (f, img, contents, end)
4409 Lisp_Object specified_color = Fassoc (symbol_color, color_symbols); 4407 Lisp_Object specified_color = Fassoc (symbol_color, color_symbols);
4410 4408
4411 if (CONSP (specified_color) && STRINGP (XCDR (specified_color))) 4409 if (CONSP (specified_color) && STRINGP (XCDR (specified_color)))
4412 if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0) 4410 {
4413 color_val = Qt; 4411 if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0)
4414 else if (x_defined_color (f, SDATA (XCDR (specified_color)), 4412 color_val = Qt;
4415 &cdef, 0)) 4413 else if (x_defined_color (f, SDATA (XCDR (specified_color)),
4416 color_val = make_number (cdef.pixel); 4414 &cdef, 0))
4415 color_val = make_number (cdef.pixel);
4416 }
4417 } 4417 }
4418 if (NILP (color_val) && max_key > 0) 4418 if (NILP (color_val) && max_key > 0)
4419 if (xstricmp (max_color, "None") == 0) 4419 {
4420 color_val = Qt; 4420 if (xstricmp (max_color, "None") == 0)
4421 else if (x_defined_color (f, max_color, &cdef, 0)) 4421 color_val = Qt;
4422 color_val = make_number (cdef.pixel); 4422 else if (x_defined_color (f, max_color, &cdef, 0))
4423 color_val = make_number (cdef.pixel);
4424 }
4423 if (!NILP (color_val)) 4425 if (!NILP (color_val))
4424 (*put_color_table) (color_table, beg, chars_per_pixel, color_val); 4426 (*put_color_table) (color_table, beg, chars_per_pixel, color_val);
4425 4427
@@ -7848,7 +7850,6 @@ gif_load (f, img)
7848 int width, height; 7850 int width, height;
7849 XImagePtr ximg; 7851 XImagePtr ximg;
7850 TimeValue time; 7852 TimeValue time;
7851 struct gcpro gcpro1;
7852 int ino; 7853 int ino;
7853 CGrafPtr old_port; 7854 CGrafPtr old_port;
7854 GDHandle old_gdh; 7855 GDHandle old_gdh;