Converting PDF with CMYK image causes GS to use 100% CPU

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
have
Posts: 7
Joined: 2009-09-16T03:06:58-07:00
Authentication code: 8675309

Converting PDF with CMYK image causes GS to use 100% CPU

Post by have »

I have a PDF with a CMYK image as background:

http://brandhouse.com/prince/test_cmyk_image.pdf

The PDF is created with Prince.

If I try to convert this to a JPG:

Code: Select all

convert test_cmyk_image.pdf output.jpg
- the GhostScript process "gs" hangs with 100% CPU usage and never completes.

If I generate the same PDF with an RGB image, the convert works fine.

When I cancel the convert command (because it just hangs), I get:

Code: Select all

convert: Postscript delegate failed `test.pdf'.
Versions:
- Version: ImageMagick 6.2.4 07/28/09 Q16 http://www.imagemagick.org
- ESP Ghostscript 8.15.3 (2006-08-25)

on a Linux Debian server.

Any ideas?
have
Posts: 7
Joined: 2009-09-16T03:06:58-07:00
Authentication code: 8675309

Re: Converting PDF with CMYK image causes GS to use 100% CPU

Post by have »

Maybe this should be posted under "Bugs"?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PDF with CMYK image causes GS to use 100% CPU

Post by fmw42 »

both your IM and your ghostscript are very very old. IM is at 6.5.6-1 (thats 320 versions past your 6.2.4) and Ghostscript is at 8.5.4. I suspect one or the other has a bug with respect to what you are trying to do. The best thing would be to upgrade.

also you can try

convert -colorspace rgb test_cmyk_image.pdf output.jpg

By the way, Prince, uses custom pdf functions that may be outside the domain of what GS can handle.

I would really recommend you give it a try with the latest versions of IM and especially GS.

You might also try running GS standalone on your pdf and see if that works.
have
Posts: 7
Joined: 2009-09-16T03:06:58-07:00
Authentication code: 8675309

Re: Converting PDF with CMYK image causes GS to use 100% CPU

Post by have »

both your IM and your ghostscript are very very old. IM is at 6.5.6-1 (thats 320 versions past your 6.2.4) and Ghostscript is at 8.5.4. I suspect one or the other has a bug with respect to what you are trying to do. The best thing would be to upgrade.
Ahaa. Well, I did that, but was using an old version of Debian Etch. I upgraded to Lenny and now it works. Thanks!

However, the version of IM is still "only":
Version: ImageMagick 6.3.7 08/07/09 Q16 http://www.imagemagick.org

But well, nevermind.

Next question: The colours are not quite right. I used the -colorspace rgb option. It looks like there is too much contrast and too much colour:

http://brandhouse.com/prince/output.jpg

Is this where I could use the -profile option with an .icc file?
Post Reply