Commit 0b3f8ca8 authored by Evgeny Zajcev's avatar Evgeny Zajcev Committed by Eli Zaretskii

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'.
parent b3ff982a
......@@ -102,7 +102,7 @@ AUTODETECT can be
(see `image-type-available-p').")
(defvar image-format-suffixes
'((image/x-icon "ico"))
'((image/x-rgb "rgb") (image/x-icon "ico"))
"An alist associating image types with file name suffixes.
This is used as a hint by the ImageMagick library when detecting
the type of image data (that does not have an associated file name).
......@@ -8540,6 +8540,14 @@ imagemagick_load_image (struct frame *f, struct image *img,
status = MagickReadImage (image_wand, filename);
Lisp_Object lwidth = image_spec_value (img->spec, QCwidth, NULL);
Lisp_Object lheight = image_spec_value (img->spec, QCheight, NULL);
if (NATNUMP (lwidth) && NATNUMP (lheight))
MagickSetSize (image_wand, XFASTINT (lwidth), XFASTINT (lheight));
MagickSetDepth (image_wand, 8);
filename_hint = imagemagick_filename_hint (img->spec, hint_buffer);
MagickSetFilename (image_wand, filename_hint);
status = MagickReadImageBlob (image_wand, contents, size);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment