Page 1 of 1

certain PDF files hang convert

Posted: 2015-04-14T15:37:22-07:00
by benparker
I'm trying to convert the first page of various PDFs to a JPG. Most of the time this works fine, but sometimes a PDF will cause the convert process to hang seemingly forever.

One example is the 2011 Annual Report for Peet's Coffee, available here: http://files.shareholder.com/downloads/ ... _ready.pdf

The command is:

Code: Select all

convert peets.pdf[0] peets.jpg
I have a convert process still running after 35+ minutes even with these environment variables set:

Code: Select all

MAGICK_THREAD_LIMIT=1
MAGICK_THROTTLE=100
MAGICK_TIME_LIMIT=180
Is this is a bug in ImageMagick or some issue with the PDF? And if it's an issue with the PDF, is there any way to truly enforce the MAGICK_TIME_LIMIT?

Re: certain PDF files hang convert

Posted: 2015-04-14T15:50:53-07:00
by fmw42
This command does not finish quickly for me either and I cancelled it. I am on IM 6.9.1.1 Q16 Mac OSX.

Code: Select all

convert 2011_Peets_Annual_Report_web_ready.pdf[0] peets.jpg

But

Code: Select all

time identify 2011_Peets_Annual_Report_w_ready.pdf
runs is 9 sec and show 67 pages:

Code: Select all

2011_Peets_Annual_Report_web_ready.pdf[0] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[1] PDF 1206x792 1206x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[2] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[3] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[4] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[5] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[6] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[7] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[8] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[9] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[10] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[11] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[12] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[13] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[14] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[15] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[16] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[17] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[18] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[19] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[20] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[21] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[22] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[23] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[24] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[25] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[26] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[27] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[28] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[29] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[30] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[31] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[32] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[33] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[34] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[35] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[36] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[37] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[38] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[39] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[40] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[41] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[42] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[43] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[44] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[45] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[46] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[47] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[48] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[49] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[50] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[51] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[52] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[53] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[54] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[55] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[56] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[57] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[58] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[59] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[60] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[61] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[62] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[63] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[64] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[65] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
2011_Peets_Annual_Report_web_ready.pdf[66] PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000

Re: certain PDF files hang convert

Posted: 2015-04-14T17:08:21-07:00
by magick
We're using ImageMagick 6.9.0-1 and Ghostscript 9.15:
  • -> time convert '2011_Peets_Annual_Report_web_ready.pdf[0]' peets.jpg
    1.540u 0.028s 0:01.56 100.0% 0+0k 0+120io 0pf+0w

Re: certain PDF files hang convert

Posted: 2015-04-14T19:17:47-07:00
by fmw42
On my INTEL 2.66 GHz Mac OSX running one thread, IM 6.9.1.1, Ghostscript 9.10 and JPEG Joint Photographic Experts Group JFIF format (90), it did not finish after 35 minutes and I cancelled it. Something is not right if I can get all 67 pages from identify in 9 sec and the conversion of the first page of size 612x792 does not finish after 35 minutes. Perhaps it is the IM version or the version of GS?

Re: certain PDF files hang convert

Posted: 2015-04-14T21:11:48-07:00
by benparker
Thanks for your replies! It must be the gs version, as I'm also using Ghostscript 9.10. IM version is 6.9.0-0.

I tried compiling ghostscript from source, but I'm running into errors so I'll need some time to go sort that out.

So what about MAGICK_TIME_LIMIT? It doesn't seem to be enforced when there is a rogue ghostscript process. Am I missing something or is that still a bug in this scenario?