SetImageColorspace difference in 6.4.8-9

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
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

SetImageColorspace difference in 6.4.8-9

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

Re: SetImageColorspace difference in 6.4.8-9

Post 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.
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

Re: SetImageColorspace difference in 6.4.8-9

Post by rmagick »

Thanks for your quick reply.
Post Reply