Page 1 of 1

SetImageColorspace difference in 6.4.8-9

Posted: 2009-01-24T08:45:59-07:00
by rmagick
The test program below fails to change the colorspace field the way it did in 6.4.7-10. Here's the 6.4.7-10 output:

Code: Select all

$ ./test_colorspace
ImageMagick 6.4.7 2008-12-17 Q16 http://www.imagemagick.org
Original Colorspace = 1
New Colorspace = 2
Here's the 6.4.8-9 output:

Code: Select all

$ ./test_colorspace
ImageMagick 6.4.8-9 2009-01-24 Q16 http://www.imagemagick.org
Original Colorspace = 1
New Colorspace = 1
Should I expect that field to be set in 6.4.8, or should I do something different?
Please let me know if you need more information.
Here's the test program:

Code: Select all

/*
gcc `Magick-config --cflags --cppflags` test_colorspace.c `Magick-config --ldflags --libs` -o test_colorspace
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <magick/MagickCore.h>

int main(int argc,char **argv)
{
    ImageInfo *info;
    Image *image;

    MagickCoreGenesis(argv[0], MagickFalse);
    puts(GetMagickVersion(NULL));

    info = CloneImageInfo(NULL);
    image = AcquireImage(info);
    SetImageExtent(image, 20, 20);
    printf("Original Colorspace = %d\n", image->colorspace);
    SetImageColorspace(image, GRAYColorspace);
    printf("New Colorspace = %d\n", image->colorspace);

    DestroyImageInfo(info);
    DestroyImage(image);
    MagickCoreTerminus();

    exit(0);
}

Re: SetImageColorspace difference in 6.4.8-9

Posted: 2009-01-24T09:29:27-07:00
by magick
The problem you reported should be ok because GRAYColorspace is treated internally as RGB, however we have a patch in the latest ImageMagick Subversion trunk available sometime tomorrow. Thanks.

Re: SetImageColorspace difference in 6.4.8-9

Posted: 2009-01-24T09:59:06-07:00
by rmagick
Thanks for your quick reply.