CMYK PDF -> Hi Res JPG trouble
Posted: 2007-02-02T10:56:54-07:00
I want to convert a PDF to high resolution JPG. The command line I finally got working with:
However, when I try to do that with magickwand, the MagickSetResolution forces a GRAY colorspace before even reading the image and I can't seem to set it back, and everything is horked. *without* setting the resolution, everything is fine.
Here is the code I am running:
Which works as long as I don't call MagickSetResolution.
Any thoughts?
Thanks.
Code: Select all
convert -density 300 -colorspace RGB cover.pdf -profile USWebCoatedSWOP.icc cover.jpg
Here is the code I am running:
Code: Select all
if( $isPdf ) {
MagickSetImageUnits( $magickWand, MW_PixelsPerInchResolution );
MagickSetResolution( $magickWand, 300, 300 );
}
MagickReadImage( $magickWand, $sourceFile );
if( MagickGetImageColorspace( $magickWand ) == MW_CMYKColorspace ) {
MagickRemoveImageProfile( $magickWand, "ICC" );
MagickSetImageProfile( $magickWand, 'ICC', file_get_contents( 'USWebCoatedSWOP.icc' ) );
MagickProfileImage($magickWand, 'ICC', file_get_contents( 'srgb.icm' ) );
MagickSetImageColorspace( $magickWand, MW_RGBColorspace );
}
Any thoughts?
Thanks.