Commit 6c596cb2 authored by Paul Eggert's avatar Paul Eggert

Don't assume that ImageMagick uses a 16-bit quantum.

* image.c (imagemagick_load_image): Port to hosts that do not use
a 16-bit quantum, i.e., QuantumRange does not equal 65535.

Fixes: debbugs:17519
parent 254b7645
2014-05-21 Paul Eggert <eggert@cs.ucla.edu>
Don't assume that ImageMagick uses a 16-bit quantum (Bug#17519).
* image.c (imagemagick_load_image): Port to hosts that do not use
a 16-bit quantum, i.e., QuantumRange does not equal 65535.
2014-05-21 Leo Liu <sdl.web@gmail.com>
* fns.c (Fnreverse): Accept strings for SEQ and update doc-string.
......
......@@ -8368,6 +8368,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
#endif /* HAVE_MAGICKEXPORTIMAGEPIXELS */
{
size_t image_height;
double color_scale = 65535.0 / QuantumRange;
/* Try to create a x pixmap to hold the imagemagick pixmap. */
if (!image_create_x_image_and_pixmap (f, img, width, height, 0,
......@@ -8408,9 +8409,9 @@ imagemagick_load_image (struct frame *f, struct image *img,
PixelGetMagickColor (pixels[x], &pixel);
XPutPixel (ximg, x, y,
lookup_rgb_color (f,
pixel.red,
pixel.green,
pixel.blue));
color_scale * pixel.red,
color_scale * pixel.green,
color_scale * pixel.blue));
}
}
DestroyPixelIterator (iterator);
......
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