Page 1 of 1

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

Posted: 2009-09-16T03:15:25-07:00
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?

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

Posted: 2009-09-16T03:54:49-07:00
by have
Maybe this should be posted under "Bugs"?

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

Posted: 2009-09-16T08:06:35-07:00
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.

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

Posted: 2009-09-16T13:49:24-07:00
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?

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

Posted: 2009-09-16T15:15:48-07:00
by fmw42