Bug in MagickGetImageRange
Posted: 2011-11-22T14:04:22-07:00
I'm using ImageMagick 6.7.3-5 built with 16 bit depth.
The small snippet below creates 1x1 image with one white pixel. I would expect it to print:
instead it does
according to comment in the source what it does is:
in this example the range is white-white.
I tried it with different built in images and it always does detect upper bound correctly and sets lower bound to 0.
And here comes full code:
Greetings
The small snippet below creates 1x1 image with one white pixel. I would expect it to print:
Code: Select all
min: 65535.000000, max: 65535.000000
Code: Select all
min: 0.000000, max: 65535.000000
Code: Select all
MagickGetImageRange() gets the range for one or more image channels.
I tried it with different built in images and it always does detect upper bound correctly and sets lower bound to 0.
And here comes full code:
Code: Select all
#include <wand/MagickWand.h>
int main()
{
MagickWandGenesis();
MagickWand* wand = NewMagickWand();
MagickReadImage(wand, "xc:white");
double min, max;
MagickGetImageRange(wand, &min, &max);
printf("min: %f, max: %f\n", min, max);
DestroyMagickWand(wand);
MagickWandTerminus();
return 0;
}