Page 1 of 1

Posted: 2006-07-26T09:04:39-07:00
by magick
We don't have MagickWand for PHP installed but we did try the following program with the C MagickWand library which MagickWand for PHP relies on and got expected results. We're using ImageMagick 6.2.8-5 and the image comparison return exact results. The command line:
  • -> convert cmyk.tif -profile USWebCoatedSWOP.icc -profile sRGB.icm im_rgb.miff
    -> wand
    -> compare -metric rms im_rgb.miff im_rgb.png test.miff
    0 dB
    1024,701,MIFF
The wand.c code:

Code: Select all

#include <stdio.h>
#include <wand/magick-wand.h>

int main()
{
  ExceptionInfo
    *exception;

  MagickWand
    *wand;

  unsigned char
    *profile;

  size_t
    length;

  MagickWandGenesis();
  wand=NewMagickWand();
  MagickReadImage(wand,"cmyk.tif");
  profile=MagickRemoveImageProfile(wand,"ICC",&length);
  if (profile == (unsigned char *) NULL)
    (void) printf("%s: does not have a ICC color profile\n","cmyk.tif");
  exception=AcquireExceptionInfo();
  profile=FileToBlob("USWebCoatedSWOP.icc",~0UL,&length,exception);
  MagickSetImageProfile(wand,"ICC",profile,length);
  profile=FileToBlob("sRGB.icm",~0UL,&length,exception);
  exception=DestroyExceptionInfo(exception);
  MagickProfileImage(wand,"ICC",profile,length);
  MagickWriteImage(wand,"im_rgb.png");
  MagickWandTerminus();
  return(0);
}