diff options
| author | Gerd Moellmann | 2000-01-01 10:35:43 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-01-01 10:35:43 +0000 |
| commit | 45158a9105d2693faa02b5dba9b52b77dab7d9e1 (patch) | |
| tree | 5b1ac02bffacaaf5c1ab124c94a1b76c0ac2605f /src | |
| parent | 63cec32f8d8c30fb562e946f4c66713905dee081 (diff) | |
| download | emacs-45158a9105d2693faa02b5dba9b52b77dab7d9e1.tar.gz emacs-45158a9105d2693faa02b5dba9b52b77dab7d9e1.zip | |
(x_create_x_image_and_pixmap): Remove parameter file.
All calls adjusted.
(x_build_heuristic_mask): Likewise.
(xbm_load_image_from_file): Change error output.
(xbm_load, xpm_load, pbm_load, png_load, jpeg_load, tiff_load)
(gif_load, gs_load, x_kill_gs_process): Ditto.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xfns.c | 97 |
2 files changed, 50 insertions, 54 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ac718260d59..93127f9b505 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2000-01-01 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-01-01 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xfns.c (x_create_x_image_and_pixmap): Remove parameter FILE. | ||
| 4 | All calls adjusted. | ||
| 5 | (x_build_heuristic_mask): Likewise. | ||
| 6 | (xbm_load_image_from_file): Change error output. | ||
| 7 | (xbm_load, xpm_load, pbm_load, png_load, jpeg_load, tiff_load) | ||
| 8 | (gif_load, gs_load, x_kill_gs_process): Ditto. | ||
| 9 | |||
| 3 | * xfns.c (gif_load): Avoid sign extension and thus out of bounds | 10 | * xfns.c (gif_load): Avoid sign extension and thus out of bounds |
| 4 | color indices when accessing raster pixels. | 11 | color indices when accessing raster pixels. |
| 5 | (gif_image_p, png_image_p, jpeg_image_p, tiff_image_p): Allow only | 12 | (gif_image_p, png_image_p, jpeg_image_p, tiff_image_p): Allow only |
diff --git a/src/xfns.c b/src/xfns.c index dc88ebe0fb8..12503851005 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5442,8 +5442,8 @@ static void define_image_type P_ ((struct image_type *type)); | |||
| 5442 | static struct image_type *lookup_image_type P_ ((Lisp_Object symbol)); | 5442 | static struct image_type *lookup_image_type P_ ((Lisp_Object symbol)); |
| 5443 | static void image_error P_ ((char *format, Lisp_Object, Lisp_Object)); | 5443 | static void image_error P_ ((char *format, Lisp_Object, Lisp_Object)); |
| 5444 | static void x_laplace P_ ((struct frame *, struct image *)); | 5444 | static void x_laplace P_ ((struct frame *, struct image *)); |
| 5445 | static int x_build_heuristic_mask P_ ((struct frame *, Lisp_Object, | 5445 | static int x_build_heuristic_mask P_ ((struct frame *, struct image *, |
| 5446 | struct image *, Lisp_Object)); | 5446 | Lisp_Object)); |
| 5447 | 5447 | ||
| 5448 | 5448 | ||
| 5449 | /* Define a new image type from TYPE. This adds a copy of TYPE to | 5449 | /* Define a new image type from TYPE. This adds a copy of TYPE to |
| @@ -6088,10 +6088,7 @@ lookup_image (f, spec) | |||
| 6088 | /* Should we built a mask heuristically? */ | 6088 | /* Should we built a mask heuristically? */ |
| 6089 | heuristic_mask = image_spec_value (spec, QCheuristic_mask, NULL); | 6089 | heuristic_mask = image_spec_value (spec, QCheuristic_mask, NULL); |
| 6090 | if (img->pixmap && !img->mask && !NILP (heuristic_mask)) | 6090 | if (img->pixmap && !img->mask && !NILP (heuristic_mask)) |
| 6091 | { | 6091 | x_build_heuristic_mask (f, img, heuristic_mask); |
| 6092 | file = image_spec_value (spec, QCfile, NULL); | ||
| 6093 | x_build_heuristic_mask (f, file, img, heuristic_mask); | ||
| 6094 | } | ||
| 6095 | } | 6092 | } |
| 6096 | } | 6093 | } |
| 6097 | 6094 | ||
| @@ -6172,9 +6169,8 @@ forall_images_in_image_cache (f, fn) | |||
| 6172 | X support code | 6169 | X support code |
| 6173 | ***********************************************************************/ | 6170 | ***********************************************************************/ |
| 6174 | 6171 | ||
| 6175 | static int x_create_x_image_and_pixmap P_ ((struct frame *, Lisp_Object, | 6172 | static int x_create_x_image_and_pixmap P_ ((struct frame *, int, int, int, |
| 6176 | int, int, int, XImage **, | 6173 | XImage **, Pixmap *)); |
| 6177 | Pixmap *)); | ||
| 6178 | static void x_destroy_x_image P_ ((XImage *)); | 6174 | static void x_destroy_x_image P_ ((XImage *)); |
| 6179 | static void x_put_x_image P_ ((struct frame *, XImage *, Pixmap, int, int)); | 6175 | static void x_put_x_image P_ ((struct frame *, XImage *, Pixmap, int, int)); |
| 6180 | 6176 | ||
| @@ -6183,13 +6179,11 @@ static void x_put_x_image P_ ((struct frame *, XImage *, Pixmap, int, int)); | |||
| 6183 | frame F. Set *XIMG and *PIXMAP to the XImage and Pixmap created. | 6179 | frame F. Set *XIMG and *PIXMAP to the XImage and Pixmap created. |
| 6184 | Set (*XIMG)->data to a raster of WIDTH x HEIGHT pixels allocated | 6180 | Set (*XIMG)->data to a raster of WIDTH x HEIGHT pixels allocated |
| 6185 | via xmalloc. Print error messages via image_error if an error | 6181 | via xmalloc. Print error messages via image_error if an error |
| 6186 | occurs. FILE is the name of an image file being processed, for | 6182 | occurs. Value is non-zero if successful. */ |
| 6187 | error messages. Value is non-zero if successful. */ | ||
| 6188 | 6183 | ||
| 6189 | static int | 6184 | static int |
| 6190 | x_create_x_image_and_pixmap (f, file, width, height, depth, ximg, pixmap) | 6185 | x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap) |
| 6191 | struct frame *f; | 6186 | struct frame *f; |
| 6192 | Lisp_Object file; | ||
| 6193 | int width, height, depth; | 6187 | int width, height, depth; |
| 6194 | XImage **ximg; | 6188 | XImage **ximg; |
| 6195 | Pixmap *pixmap; | 6189 | Pixmap *pixmap; |
| @@ -6207,7 +6201,7 @@ x_create_x_image_and_pixmap (f, file, width, height, depth, ximg, pixmap) | |||
| 6207 | depth > 16 ? 32 : depth > 8 ? 16 : 8, 0); | 6201 | depth > 16 ? 32 : depth > 8 ? 16 : 8, 0); |
| 6208 | if (*ximg == NULL) | 6202 | if (*ximg == NULL) |
| 6209 | { | 6203 | { |
| 6210 | image_error ("Unable to allocate X image for %s", file, Qnil); | 6204 | image_error ("Unable to allocate X image", Qnil, Qnil); |
| 6211 | return 0; | 6205 | return 0; |
| 6212 | } | 6206 | } |
| 6213 | 6207 | ||
| @@ -6220,7 +6214,7 @@ x_create_x_image_and_pixmap (f, file, width, height, depth, ximg, pixmap) | |||
| 6220 | { | 6214 | { |
| 6221 | x_destroy_x_image (*ximg); | 6215 | x_destroy_x_image (*ximg); |
| 6222 | *ximg = NULL; | 6216 | *ximg = NULL; |
| 6223 | image_error ("Unable to create pixmap for `%s'", file, Qnil); | 6217 | image_error ("Unable to create X pixmap", Qnil, Qnil); |
| 6224 | return 0; | 6218 | return 0; |
| 6225 | } | 6219 | } |
| 6226 | 6220 | ||
| @@ -6735,7 +6729,7 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 6735 | file = x_find_image_file (specified_file); | 6729 | file = x_find_image_file (specified_file); |
| 6736 | if (!STRINGP (file)) | 6730 | if (!STRINGP (file)) |
| 6737 | { | 6731 | { |
| 6738 | image_error ("Cannot find image file %s", specified_file, Qnil); | 6732 | image_error ("Cannot find image file `%s'", specified_file, Qnil); |
| 6739 | UNGCPRO; | 6733 | UNGCPRO; |
| 6740 | return 0; | 6734 | return 0; |
| 6741 | } | 6735 | } |
| @@ -6781,7 +6775,7 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 6781 | UNBLOCK_INPUT; | 6775 | UNBLOCK_INPUT; |
| 6782 | } | 6776 | } |
| 6783 | else | 6777 | else |
| 6784 | image_error ("Error loading XBM image %s", img->spec, Qnil); | 6778 | image_error ("Error loading XBM image `%s'", img->spec, Qnil); |
| 6785 | 6779 | ||
| 6786 | UNGCPRO; | 6780 | UNGCPRO; |
| 6787 | return success_p; | 6781 | return success_p; |
| @@ -6874,7 +6868,8 @@ xbm_load (f, img) | |||
| 6874 | success_p = 1; | 6868 | success_p = 1; |
| 6875 | else | 6869 | else |
| 6876 | { | 6870 | { |
| 6877 | image_error ("Unable to create pixmap for XBM image", Qnil, Qnil); | 6871 | image_error ("Unable to create pixmap for XBM image `%s'", |
| 6872 | img->spec, Qnil); | ||
| 6878 | x_clear_image (f, img); | 6873 | x_clear_image (f, img); |
| 6879 | } | 6874 | } |
| 6880 | 6875 | ||
| @@ -7059,7 +7054,7 @@ xpm_load (f, img) | |||
| 7059 | Lisp_Object file = x_find_image_file (specified_file); | 7054 | Lisp_Object file = x_find_image_file (specified_file); |
| 7060 | if (!STRINGP (file)) | 7055 | if (!STRINGP (file)) |
| 7061 | { | 7056 | { |
| 7062 | image_error ("Cannot find image file %s", specified_file, Qnil); | 7057 | image_error ("Cannot find image file `%s'", specified_file, Qnil); |
| 7063 | UNBLOCK_INPUT; | 7058 | UNBLOCK_INPUT; |
| 7064 | return 0; | 7059 | return 0; |
| 7065 | } | 7060 | } |
| @@ -7416,7 +7411,7 @@ x_laplace (f, img) | |||
| 7416 | out = (long *) alloca (img->width * sizeof (long)); | 7411 | out = (long *) alloca (img->width * sizeof (long)); |
| 7417 | 7412 | ||
| 7418 | /* Create an X image for output. */ | 7413 | /* Create an X image for output. */ |
| 7419 | rc = x_create_x_image_and_pixmap (f, Qnil, img->width, img->height, 0, | 7414 | rc = x_create_x_image_and_pixmap (f, img->width, img->height, 0, |
| 7420 | &oimg, &pixmap); | 7415 | &oimg, &pixmap); |
| 7421 | 7416 | ||
| 7422 | /* Fill first two rows. */ | 7417 | /* Fill first two rows. */ |
| @@ -7482,9 +7477,8 @@ x_laplace (f, img) | |||
| 7482 | heuristically. Value is non-zero if successful. */ | 7477 | heuristically. Value is non-zero if successful. */ |
| 7483 | 7478 | ||
| 7484 | static int | 7479 | static int |
| 7485 | x_build_heuristic_mask (f, file, img, how) | 7480 | x_build_heuristic_mask (f, img, how) |
| 7486 | struct frame *f; | 7481 | struct frame *f; |
| 7487 | Lisp_Object file; | ||
| 7488 | struct image *img; | 7482 | struct image *img; |
| 7489 | Lisp_Object how; | 7483 | Lisp_Object how; |
| 7490 | { | 7484 | { |
| @@ -7496,7 +7490,7 @@ x_build_heuristic_mask (f, file, img, how) | |||
| 7496 | BLOCK_INPUT; | 7490 | BLOCK_INPUT; |
| 7497 | 7491 | ||
| 7498 | /* Create an image and pixmap serving as mask. */ | 7492 | /* Create an image and pixmap serving as mask. */ |
| 7499 | rc = x_create_x_image_and_pixmap (f, file, img->width, img->height, 1, | 7493 | rc = x_create_x_image_and_pixmap (f, img->width, img->height, 1, |
| 7500 | &mask_img, &img->mask); | 7494 | &mask_img, &img->mask); |
| 7501 | if (!rc) | 7495 | if (!rc) |
| 7502 | { | 7496 | { |
| @@ -7785,7 +7779,7 @@ pbm_load (f, img) | |||
| 7785 | /* Check magic number. */ | 7779 | /* Check magic number. */ |
| 7786 | if (end - p < 2 || *p++ != 'P') | 7780 | if (end - p < 2 || *p++ != 'P') |
| 7787 | { | 7781 | { |
| 7788 | image_error ("Not a PBM image: %s", file, Qnil); | 7782 | image_error ("Not a PBM image: `%s'", img->spec, Qnil); |
| 7789 | error: | 7783 | error: |
| 7790 | xfree (contents); | 7784 | xfree (contents); |
| 7791 | UNGCPRO; | 7785 | UNGCPRO; |
| @@ -7819,7 +7813,7 @@ pbm_load (f, img) | |||
| 7819 | break; | 7813 | break; |
| 7820 | 7814 | ||
| 7821 | default: | 7815 | default: |
| 7822 | image_error ("Not a PBM image: %s", file, Qnil); | 7816 | image_error ("Not a PBM image: `%s'", img->spec, Qnil); |
| 7823 | goto error; | 7817 | goto error; |
| 7824 | } | 7818 | } |
| 7825 | 7819 | ||
| @@ -7841,7 +7835,7 @@ pbm_load (f, img) | |||
| 7841 | goto error; | 7835 | goto error; |
| 7842 | 7836 | ||
| 7843 | BLOCK_INPUT; | 7837 | BLOCK_INPUT; |
| 7844 | if (!x_create_x_image_and_pixmap (f, file, width, height, 0, | 7838 | if (!x_create_x_image_and_pixmap (f, width, height, 0, |
| 7845 | &ximg, &img->pixmap)) | 7839 | &ximg, &img->pixmap)) |
| 7846 | { | 7840 | { |
| 7847 | UNBLOCK_INPUT; | 7841 | UNBLOCK_INPUT; |
| @@ -7901,8 +7895,8 @@ pbm_load (f, img) | |||
| 7901 | ximg->data = NULL; | 7895 | ximg->data = NULL; |
| 7902 | XDestroyImage (ximg); | 7896 | XDestroyImage (ximg); |
| 7903 | UNBLOCK_INPUT; | 7897 | UNBLOCK_INPUT; |
| 7904 | image_error ("Invalid pixel value in file `%s'", | 7898 | image_error ("Invalid pixel value in image `%s'", |
| 7905 | file, Qnil); | 7899 | img->spec, Qnil); |
| 7906 | goto error; | 7900 | goto error; |
| 7907 | } | 7901 | } |
| 7908 | 7902 | ||
| @@ -8106,7 +8100,7 @@ png_load (f, img) | |||
| 8106 | file = x_find_image_file (specified_file); | 8100 | file = x_find_image_file (specified_file); |
| 8107 | if (!STRINGP (file)) | 8101 | if (!STRINGP (file)) |
| 8108 | { | 8102 | { |
| 8109 | image_error ("Cannot find image file %s", specified_file, Qnil); | 8103 | image_error ("Cannot find image file `%s'", specified_file, Qnil); |
| 8110 | UNGCPRO; | 8104 | UNGCPRO; |
| 8111 | return 0; | 8105 | return 0; |
| 8112 | } | 8106 | } |
| @@ -8115,7 +8109,7 @@ png_load (f, img) | |||
| 8115 | fp = fopen (XSTRING (file)->data, "rb"); | 8109 | fp = fopen (XSTRING (file)->data, "rb"); |
| 8116 | if (!fp) | 8110 | if (!fp) |
| 8117 | { | 8111 | { |
| 8118 | image_error ("Cannot open image file %s", file, Qnil); | 8112 | image_error ("Cannot open image file `%s'", file, Qnil); |
| 8119 | UNGCPRO; | 8113 | UNGCPRO; |
| 8120 | fclose (fp); | 8114 | fclose (fp); |
| 8121 | return 0; | 8115 | return 0; |
| @@ -8125,7 +8119,7 @@ png_load (f, img) | |||
| 8125 | if (fread (sig, 1, sizeof sig, fp) != sizeof sig | 8119 | if (fread (sig, 1, sizeof sig, fp) != sizeof sig |
| 8126 | || !png_check_sig (sig, sizeof sig)) | 8120 | || !png_check_sig (sig, sizeof sig)) |
| 8127 | { | 8121 | { |
| 8128 | image_error ("Not a PNG file: %s", file, Qnil); | 8122 | image_error ("Not a PNG file: `%s'", file, Qnil); |
| 8129 | UNGCPRO; | 8123 | UNGCPRO; |
| 8130 | fclose (fp); | 8124 | fclose (fp); |
| 8131 | return 0; | 8125 | return 0; |
| @@ -8142,7 +8136,7 @@ png_load (f, img) | |||
| 8142 | if (tbr.len < sizeof sig | 8136 | if (tbr.len < sizeof sig |
| 8143 | || !png_check_sig (tbr.bytes, sizeof sig)) | 8137 | || !png_check_sig (tbr.bytes, sizeof sig)) |
| 8144 | { | 8138 | { |
| 8145 | image_error ("Not a PNG file: %s", file, Qnil); | 8139 | image_error ("Not a PNG image: `%s'", img->spec, Qnil); |
| 8146 | UNGCPRO; | 8140 | UNGCPRO; |
| 8147 | return 0; | 8141 | return 0; |
| 8148 | } | 8142 | } |
| @@ -8316,7 +8310,7 @@ png_load (f, img) | |||
| 8316 | BLOCK_INPUT; | 8310 | BLOCK_INPUT; |
| 8317 | 8311 | ||
| 8318 | /* Create the X image and pixmap. */ | 8312 | /* Create the X image and pixmap. */ |
| 8319 | if (!x_create_x_image_and_pixmap (f, file, width, height, 0, &ximg, | 8313 | if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, |
| 8320 | &img->pixmap)) | 8314 | &img->pixmap)) |
| 8321 | { | 8315 | { |
| 8322 | UNBLOCK_INPUT; | 8316 | UNBLOCK_INPUT; |
| @@ -8327,7 +8321,7 @@ png_load (f, img) | |||
| 8327 | contains an alpha channel. */ | 8321 | contains an alpha channel. */ |
| 8328 | if (channels == 4 | 8322 | if (channels == 4 |
| 8329 | && !transparent_p | 8323 | && !transparent_p |
| 8330 | && !x_create_x_image_and_pixmap (f, file, width, height, 1, | 8324 | && !x_create_x_image_and_pixmap (f, width, height, 1, |
| 8331 | &mask_img, &img->mask)) | 8325 | &mask_img, &img->mask)) |
| 8332 | { | 8326 | { |
| 8333 | x_destroy_x_image (ximg); | 8327 | x_destroy_x_image (ximg); |
| @@ -8637,13 +8631,12 @@ jpeg_load (f, img) | |||
| 8637 | file = Qnil; | 8631 | file = Qnil; |
| 8638 | GCPRO1 (file); | 8632 | GCPRO1 (file); |
| 8639 | 8633 | ||
| 8640 | /* Reading from :data takes precedence. */ | ||
| 8641 | if (NILP (specified_data)) | 8634 | if (NILP (specified_data)) |
| 8642 | { | 8635 | { |
| 8643 | file = x_find_image_file (specified_file); | 8636 | file = x_find_image_file (specified_file); |
| 8644 | if (!STRINGP (file)) | 8637 | if (!STRINGP (file)) |
| 8645 | { | 8638 | { |
| 8646 | image_error ("Cannot find image file %s", specified_file, Qnil); | 8639 | image_error ("Cannot find image file `%s'", specified_file, Qnil); |
| 8647 | UNGCPRO; | 8640 | UNGCPRO; |
| 8648 | return 0; | 8641 | return 0; |
| 8649 | } | 8642 | } |
| @@ -8669,7 +8662,7 @@ jpeg_load (f, img) | |||
| 8669 | /* Called from my_error_exit. Display a JPEG error. */ | 8662 | /* Called from my_error_exit. Display a JPEG error. */ |
| 8670 | char buffer[JMSG_LENGTH_MAX]; | 8663 | char buffer[JMSG_LENGTH_MAX]; |
| 8671 | cinfo.err->format_message ((j_common_ptr) &cinfo, buffer); | 8664 | cinfo.err->format_message ((j_common_ptr) &cinfo, buffer); |
| 8672 | image_error ("Error reading JPEG file `%s': %s", file, | 8665 | image_error ("Error reading JPEG image `%s': %s", img->spec, |
| 8673 | build_string (buffer)); | 8666 | build_string (buffer)); |
| 8674 | } | 8667 | } |
| 8675 | 8668 | ||
| @@ -8713,8 +8706,7 @@ jpeg_load (f, img) | |||
| 8713 | BLOCK_INPUT; | 8706 | BLOCK_INPUT; |
| 8714 | 8707 | ||
| 8715 | /* Create X image and pixmap. */ | 8708 | /* Create X image and pixmap. */ |
| 8716 | if (!x_create_x_image_and_pixmap (f, file, width, height, 0, &ximg, | 8709 | if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) |
| 8717 | &img->pixmap)) | ||
| 8718 | { | 8710 | { |
| 8719 | UNBLOCK_INPUT; | 8711 | UNBLOCK_INPUT; |
| 8720 | longjmp (mgr.setjmp_buffer, 2); | 8712 | longjmp (mgr.setjmp_buffer, 2); |
| @@ -9001,7 +8993,7 @@ tiff_load (f, img) | |||
| 9001 | file = x_find_image_file (specified_file); | 8993 | file = x_find_image_file (specified_file); |
| 9002 | if (!STRINGP (file)) | 8994 | if (!STRINGP (file)) |
| 9003 | { | 8995 | { |
| 9004 | image_error ("Cannot find image file %s", file, Qnil); | 8996 | image_error ("Cannot find image file `%s'", file, Qnil); |
| 9005 | UNGCPRO; | 8997 | UNGCPRO; |
| 9006 | return 0; | 8998 | return 0; |
| 9007 | } | 8999 | } |
| @@ -9033,8 +9025,7 @@ tiff_load (f, img) | |||
| 9033 | 9025 | ||
| 9034 | if (!tiff) | 9026 | if (!tiff) |
| 9035 | { | 9027 | { |
| 9036 | image_error ("Cannot open memory source `%s'. ", | 9028 | image_error ("Cannot open memory source for `%s'", img->spec, Qnil); |
| 9037 | specified_data, Qnil); | ||
| 9038 | UNGCPRO; | 9029 | UNGCPRO; |
| 9039 | return 0; | 9030 | return 0; |
| 9040 | } | 9031 | } |
| @@ -9050,7 +9041,7 @@ tiff_load (f, img) | |||
| 9050 | TIFFClose (tiff); | 9041 | TIFFClose (tiff); |
| 9051 | if (!rc) | 9042 | if (!rc) |
| 9052 | { | 9043 | { |
| 9053 | image_error ("Error reading `%s'", file, Qnil); | 9044 | image_error ("Error reading TIFF image `%s'", img->spec, Qnil); |
| 9054 | xfree (buf); | 9045 | xfree (buf); |
| 9055 | UNGCPRO; | 9046 | UNGCPRO; |
| 9056 | return 0; | 9047 | return 0; |
| @@ -9059,8 +9050,7 @@ tiff_load (f, img) | |||
| 9059 | BLOCK_INPUT; | 9050 | BLOCK_INPUT; |
| 9060 | 9051 | ||
| 9061 | /* Create the X image and pixmap. */ | 9052 | /* Create the X image and pixmap. */ |
| 9062 | if (!x_create_x_image_and_pixmap (f, file, width, height, 0, &ximg, | 9053 | if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) |
| 9063 | &img->pixmap)) | ||
| 9064 | { | 9054 | { |
| 9065 | UNBLOCK_INPUT; | 9055 | UNBLOCK_INPUT; |
| 9066 | xfree (buf); | 9056 | xfree (buf); |
| @@ -9243,7 +9233,7 @@ gif_load (f, img) | |||
| 9243 | file = x_find_image_file (specified_file); | 9233 | file = x_find_image_file (specified_file); |
| 9244 | if (!STRINGP (file)) | 9234 | if (!STRINGP (file)) |
| 9245 | { | 9235 | { |
| 9246 | image_error ("Cannot find image file %s", specified_file, Qnil); | 9236 | image_error ("Cannot find image file `%s'", specified_file, Qnil); |
| 9247 | UNGCPRO; | 9237 | UNGCPRO; |
| 9248 | return 0; | 9238 | return 0; |
| 9249 | } | 9239 | } |
| @@ -9267,7 +9257,7 @@ gif_load (f, img) | |||
| 9267 | gif = DGifOpen(&memsrc, gif_read_from_memory); | 9257 | gif = DGifOpen(&memsrc, gif_read_from_memory); |
| 9268 | if (!gif) | 9258 | if (!gif) |
| 9269 | { | 9259 | { |
| 9270 | image_error ("Cannot open memory source `%s'",specified_data, Qnil); | 9260 | image_error ("Cannot open memory source `%s'", img->spec, Qnil); |
| 9271 | UNGCPRO; | 9261 | UNGCPRO; |
| 9272 | return 0; | 9262 | return 0; |
| 9273 | } | 9263 | } |
| @@ -9277,7 +9267,7 @@ gif_load (f, img) | |||
| 9277 | rc = DGifSlurp (gif); | 9267 | rc = DGifSlurp (gif); |
| 9278 | if (rc == GIF_ERROR) | 9268 | if (rc == GIF_ERROR) |
| 9279 | { | 9269 | { |
| 9280 | image_error ("Error reading `%s'", file, Qnil); | 9270 | image_error ("Error reading `%s'", img->spec, Qnil); |
| 9281 | DGifCloseFile (gif); | 9271 | DGifCloseFile (gif); |
| 9282 | UNGCPRO; | 9272 | UNGCPRO; |
| 9283 | return 0; | 9273 | return 0; |
| @@ -9287,7 +9277,8 @@ gif_load (f, img) | |||
| 9287 | ino = INTEGERP (image) ? XFASTINT (image) : 0; | 9277 | ino = INTEGERP (image) ? XFASTINT (image) : 0; |
| 9288 | if (ino >= gif->ImageCount) | 9278 | if (ino >= gif->ImageCount) |
| 9289 | { | 9279 | { |
| 9290 | image_error ("Invalid image number `%s'", image, Qnil); | 9280 | image_error ("Invalid image number `%s' in image `%s'", |
| 9281 | image, img->spec); | ||
| 9291 | DGifCloseFile (gif); | 9282 | DGifCloseFile (gif); |
| 9292 | UNGCPRO; | 9283 | UNGCPRO; |
| 9293 | return 0; | 9284 | return 0; |
| @@ -9299,8 +9290,7 @@ gif_load (f, img) | |||
| 9299 | BLOCK_INPUT; | 9290 | BLOCK_INPUT; |
| 9300 | 9291 | ||
| 9301 | /* Create the X image and pixmap. */ | 9292 | /* Create the X image and pixmap. */ |
| 9302 | if (!x_create_x_image_and_pixmap (f, file, width, height, 0, &ximg, | 9293 | if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) |
| 9303 | &img->pixmap)) | ||
| 9304 | { | 9294 | { |
| 9305 | UNBLOCK_INPUT; | 9295 | UNBLOCK_INPUT; |
| 9306 | DGifCloseFile (gif); | 9296 | DGifCloseFile (gif); |
| @@ -9566,8 +9556,7 @@ gs_load (f, img) | |||
| 9566 | 9556 | ||
| 9567 | if (!img->pixmap) | 9557 | if (!img->pixmap) |
| 9568 | { | 9558 | { |
| 9569 | image_error ("Unable to create pixmap for `%s'", | 9559 | image_error ("Unable to create pixmap for `%s'", img->spec, Qnil); |
| 9570 | image_spec_value (img->spec, QCfile, NULL), Qnil); | ||
| 9571 | return 0; | 9560 | return 0; |
| 9572 | } | 9561 | } |
| 9573 | 9562 | ||
| @@ -9679,7 +9668,7 @@ x_kill_gs_process (pixmap, f) | |||
| 9679 | } | 9668 | } |
| 9680 | else | 9669 | else |
| 9681 | image_error ("Cannot get X image of `%s'; colors will not be freed", | 9670 | image_error ("Cannot get X image of `%s'; colors will not be freed", |
| 9682 | image_spec_value (img->spec, QCfile, NULL), Qnil); | 9671 | img->spec, Qnil); |
| 9683 | 9672 | ||
| 9684 | UNBLOCK_INPUT; | 9673 | UNBLOCK_INPUT; |
| 9685 | } | 9674 | } |