Hej,

I am trying to read a JPEG image and to write it as PPM on stdout:
But despite the fact that I try to change the wand format (using
MagickSetFormat), the written image seems to remain in JPEG format...

Any hint?
many thanks!,
/Christophe.

PS is there any web place with tutorial using the C interface (apart from
the 3 examples provided)... or any more descriptive docs?

Here is the related fragment of code:

 //    Read an image.
  MagickWandGenesis();
  magick_wand=NewMagickWand();
  status=MagickReadImage(magick_wand,argv[1]);
  if (status == MagickFalse)
    ThrowWandException(magick_wand);

//set the image format to PPM:
  status =  MagickSetFormat(magick_wand,"PPM");
  if (status == MagickFalse)
    ThrowWandException(magick_wand);

 //set the image compression:
  status = MagickSetCompression(magick_wand, UndefinedCompression);
  if (status == MagickFalse)
    ThrowWandException(magick_wand);

//set the image pixel depth:
  status = MagickSetDepth(magick_wand, 8);
  if (status == MagickFalse)
    ThrowWandException(magick_wand);

 //set the image filename:
  status = MagickSetFilename(magick_wand, "");
  if (status == MagickFalse)
    ThrowWandException(magick_wand);

 //write the file to stdout:
  status = *MagickWriteImageFile(magick_wand, stdout);
  if (status == MagickFalse)
    ThrowWandException(magick_wand);*

//free and exit
  magick_wand=DestroyMagickWand(magick_wand);
  MagickWandTerminus();
  return(0);
}
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to