Problem converting colorspace

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
dirving
Posts: 13
Joined: 2008-08-28T13:45:14-07:00

Problem converting colorspace

Post by dirving »

Hi guys,

I have an issue that's either caused by me being dumb (a strong possibility) or an issue in the latest IM (6.7.5-6). I have a small image conversion program that I wrote to help with some day-to-day tasks and I was previously using IM version 6.4.7 in which this code worked. Wanting to keep up with the times, I upgraded to 6.7.5-6 and I now get an error. The code (I did remove some error checking code, etc to keep it as simple as possible but I will add it back if requested) is:

Code: Select all

MagickRemoveImageProfile(wand,"ICC",&length);

exception = AcquireExceptionInfo();

if (strcmp(currentColorspace, "cmyk") == 0) {
        cmykProfile = FileToBlob("USWebCoatedSWOP.icc",~0UL,&length,exception);
        MagickSetImageProfile(wand,"ICC",cmykProfile,length);
}

rgbProfile = FileToBlob("sRGB.icc",~0UL,&length,exception);
MagickProfileImage(wand,"ICC",rgbProfile,length);
MagickSetImageColorspace(wand, RGBColorspace);
MagickWriteImages(wand,file->tempfile,MagickTrue);
wand = DestroyMagickWand(wand);
MagickWandTerminus();
The hope here is that it converts an image in the CMYK colorspace to an RGB colorspace. The error I receive is a fatal error and happens when the DestroyMagickWand call is made. The error is:

magick/semaphore.c:273: LockSemaphoreInfo: Assertion `semaphore_info != (SemaphoreInfo *) ((void *)0)' failed.

Like I said, this worked great before so I either I had a bug that worked in my favour or something has changed and I need to adapt my code. Any thoughts/comments/etc are appreciated!

Thanks,
David
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem converting colorspace

Post by magick »

Post a URL so we can download your program along with any requisite image or color profiles. We need to reproduce the fault and trace it with a debugger to determine if its a logic error or a bug in ImageMagick.
Post Reply