diff options
| author | Evgeny Zajcev | 2016-12-02 12:09:31 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-12-02 12:09:31 +0200 |
| commit | 0b3f8ca863e7df08e79a935946f7190e595cae2b (patch) | |
| tree | fb697d6ba89eafb45c971a1bf52b537dcac6ebe9 /src | |
| parent | b3ff982a99a2fc330677b13884f9723912668e06 (diff) | |
| download | emacs-0b3f8ca863e7df08e79a935946f7190e595cae2b.tar.gz emacs-0b3f8ca863e7df08e79a935946f7190e595cae2b.zip | |
Support for rawrgb images using imagemagick
* src/image.c (imagemagick_load_image): Set wand size before loading
blob when ':width' and ':height' are provided.
* lisp/image.el (image-format-suffixes): Add 'image/x-rgb'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c index b5b713c9061..a87dc4d4737 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -8540,6 +8540,14 @@ imagemagick_load_image (struct frame *f, struct image *img, | |||
| 8540 | status = MagickReadImage (image_wand, filename); | 8540 | status = MagickReadImage (image_wand, filename); |
| 8541 | else | 8541 | else |
| 8542 | { | 8542 | { |
| 8543 | Lisp_Object lwidth = image_spec_value (img->spec, QCwidth, NULL); | ||
| 8544 | Lisp_Object lheight = image_spec_value (img->spec, QCheight, NULL); | ||
| 8545 | |||
| 8546 | if (NATNUMP (lwidth) && NATNUMP (lheight)) | ||
| 8547 | { | ||
| 8548 | MagickSetSize (image_wand, XFASTINT (lwidth), XFASTINT (lheight)); | ||
| 8549 | MagickSetDepth (image_wand, 8); | ||
| 8550 | } | ||
| 8543 | filename_hint = imagemagick_filename_hint (img->spec, hint_buffer); | 8551 | filename_hint = imagemagick_filename_hint (img->spec, hint_buffer); |
| 8544 | MagickSetFilename (image_wand, filename_hint); | 8552 | MagickSetFilename (image_wand, filename_hint); |
| 8545 | status = MagickReadImageBlob (image_wand, contents, size); | 8553 | status = MagickReadImageBlob (image_wand, contents, size); |