+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.
#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,
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);