Bug in MagickGetImageRange

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
squeaky
Posts: 2
Joined: 2011-10-31T12:00:16-07:00
Authentication code: 8675308

Bug in MagickGetImageRange

Post by squeaky »

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:

Code: Select all

min: 65535.000000, max: 65535.000000
instead it does

Code: Select all

min: 0.000000, max: 65535.000000
according to comment in the source what it does is:

Code: Select all

MagickGetImageRange() gets the range for one or more image channels.
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:

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;
}
Greetings
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in MagickGetImageRange

Post by magick »

We can reproduce the problem you posted and will have a patch in the next point release of ImageMagick. Thanks.
Post Reply