Page 1 of 1

Problem converting colorspace

Posted: 2012-02-15T08:22:51-07:00
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

Re: Problem converting colorspace

Posted: 2012-02-15T08:45:40-07:00
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.