diff options
| author | Joakim Verona | 2010-05-14 12:07:01 +0200 |
|---|---|---|
| committer | Joakim Verona | 2010-05-14 12:07:01 +0200 |
| commit | 431dab046cf9d7360d393a6dc2f1cac369cebe8f (patch) | |
| tree | b84a7a52770fef6924bbcb08f420e4eaf1eafb3a /src | |
| parent | 3b8916b60a47fae40b9833c2abb2ff3695ca5f81 (diff) | |
| download | emacs-431dab046cf9d7360d393a6dc2f1cac369cebe8f.tar.gz emacs-431dab046cf9d7360d393a6dc2f1cac369cebe8f.zip | |
configure support for MagickExportImagePixels and README
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.in | 3 | ||||
| -rw-r--r-- | src/image.c | 34 |
2 files changed, 22 insertions, 15 deletions
diff --git a/src/config.in b/src/config.in index 9020d976342..29b2a0b967f 100644 --- a/src/config.in +++ b/src/config.in | |||
| @@ -438,6 +438,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 438 | /* Define to 1 if you have the <mach/mach.h> header file. */ | 438 | /* Define to 1 if you have the <mach/mach.h> header file. */ |
| 439 | #undef HAVE_MACH_MACH_H | 439 | #undef HAVE_MACH_MACH_H |
| 440 | 440 | ||
| 441 | /* Define to 1 if you have the `MagickExportImagePixels' function. */ | ||
| 442 | #undef HAVE_MAGICKEXPORTIMAGEPIXELS | ||
| 443 | |||
| 441 | /* Define to 1 if you have the <maillock.h> header file. */ | 444 | /* Define to 1 if you have the <maillock.h> header file. */ |
| 442 | #undef HAVE_MAILLOCK_H | 445 | #undef HAVE_MAILLOCK_H |
| 443 | 446 | ||
diff --git a/src/image.c b/src/image.c index 1bc58db57b8..3ba36559839 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -7755,15 +7755,22 @@ imagemagick_load_image (f, img, contents, size, filename) | |||
| 7755 | long ino; | 7755 | long ino; |
| 7756 | image = image_spec_value (img->spec, QCindex, NULL); | 7756 | image = image_spec_value (img->spec, QCindex, NULL); |
| 7757 | ino = INTEGERP (image) ? XFASTINT (image) : 0; | 7757 | ino = INTEGERP (image) ? XFASTINT (image) : 0; |
| 7758 | |||
| 7759 | /* if (ino >= ) */ | ||
| 7760 | /* { */ | ||
| 7761 | /* image_error ("Invalid image number `%s' in image `%s'", */ | ||
| 7762 | /* image, img->spec); */ | ||
| 7763 | /* UNGCPRO; */ | ||
| 7764 | /* return 0; */ | ||
| 7765 | /* } */ | ||
| 7766 | 7758 | ||
| 7759 | |||
| 7760 | |||
| 7761 | if (ino >= MagickGetNumberImages(image_wand)) | ||
| 7762 | { | ||
| 7763 | image_error ("Invalid image number `%s' in image `%s'", | ||
| 7764 | image, img->spec); | ||
| 7765 | UNGCPRO; | ||
| 7766 | return 0; | ||
| 7767 | } | ||
| 7768 | |||
| 7769 | |||
| 7770 | if (MagickGetNumberImages(image_wand) > 1) | ||
| 7771 | img->data.lisp_val = Fcons (Qcount, | ||
| 7772 | Fcons (make_number (MagickGetNumberImages(image_wand)), | ||
| 7773 | img->data.lisp_val)); | ||
| 7767 | if(ino==0) | 7774 | if(ino==0) |
| 7768 | MagickSetFirstIterator(image_wand); | 7775 | MagickSetFirstIterator(image_wand); |
| 7769 | else | 7776 | else |
| @@ -7917,6 +7924,7 @@ imagemagick_load_image (f, img, contents, size, filename) | |||
| 7917 | 7924 | ||
| 7918 | */ | 7925 | */ |
| 7919 | pixelwidth=CharPixel;/*??? TODO figure out*/ | 7926 | pixelwidth=CharPixel;/*??? TODO figure out*/ |
| 7927 | #ifdef HAVE_MAGICKEXPORTIMAGEPIXELS | ||
| 7920 | MagickExportImagePixels(image_wand, | 7928 | MagickExportImagePixels(image_wand, |
| 7921 | 0,0, | 7929 | 0,0, |
| 7922 | width,height, | 7930 | width,height, |
| @@ -7924,16 +7932,12 @@ imagemagick_load_image (f, img, contents, size, filename) | |||
| 7924 | pixelwidth, | 7932 | pixelwidth, |
| 7925 | /*&(img->pixmap));*/ | 7933 | /*&(img->pixmap));*/ |
| 7926 | ximg->data); | 7934 | ximg->data); |
| 7935 | #else | ||
| 7936 | image_error("You dont have MagickExportImagePixels, upgrade ImageMagick if you want to try it!",Qnil,Qnil); | ||
| 7937 | #endif | ||
| 7927 | } | 7938 | } |
| 7928 | 7939 | ||
| 7929 | 7940 | ||
| 7930 | //TODO figure out imagecount here! | ||
| 7931 | if (MagickGetNumberImages(image_wand) > 1) | ||
| 7932 | img->data.lisp_val = Fcons (Qcount, | ||
| 7933 | Fcons (make_number (MagickGetNumberImages(image_wand)), | ||
| 7934 | img->data.lisp_val)); | ||
| 7935 | |||
| 7936 | |||
| 7937 | #ifdef COLOR_TABLE_SUPPORT | 7941 | #ifdef COLOR_TABLE_SUPPORT |
| 7938 | /* Remember colors allocated for this image. */ | 7942 | /* Remember colors allocated for this image. */ |
| 7939 | img->colors = colors_in_color_table (&img->ncolors); | 7943 | img->colors = colors_in_color_table (&img->ncolors); |