Identifying and converting a PDF causes delegate to stall
Posted: 2019-02-26T16:39:25-07:00
Long-time user, first-time poster. I was unable to find a solution to my problem here, so here to create a topic.
We use Windows ImageMagick 6.9.3-8 Q16 x64 to create thumbnails out of the first page of PDFs, and we do so by using x64 GhostScript 9.06 as a delegate, which we configured in the delegates.xml as such:
Recently, we came across a PDF file (54 pages; ~34MB) that was a bit different than the others, because whenever we tried to run identify and convert on it, the program would stall indefinitely. Running it against GhostScript works as intended, however. I can provide a "-debug all" by request.
We're wondering what would cause the delegate to stall as it does, and how can we get it to un-stall and process the PDF normally, if possible. This is an odd problem for us because no other PDF we've processed had yet to run into this problem. We've tried 7.0.8-28 Q16 x64 to no avail, and while a later version of GhostScript (9.22) solves the problem, we can't upgrade that due to the AGPL license switch.
As an example, here are our arguments for the identify and convert call:
I appreciate your time in advance.
We use Windows ImageMagick 6.9.3-8 Q16 x64 to create thumbnails out of the first page of PDFs, and we do so by using x64 GhostScript 9.06 as a delegate, which we configured in the delegates.xml as such:
Code: Select all
<delegate decode="pdf" encode="ps" mode="bi" command=""gswin64c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=ps2write "-sOutputFile=%o" -- "%i""/>
We're wondering what would cause the delegate to stall as it does, and how can we get it to un-stall and process the PDF normally, if possible. This is an odd problem for us because no other PDF we've processed had yet to run into this problem. We've tried 7.0.8-28 Q16 x64 to no avail, and while a later version of GhostScript (9.22) solves the problem, we can't upgrade that due to the AGPL license switch.
As an example, here are our arguments for the identify and convert call:
Code: Select all
./identify.exe -format "Format : %m
Dimension : %G
IccProfile : %[profile:icc]
Colorspace : %[colorspace]
Opaque : %[opaque]
X Resolution: %x
Y Resolution: %y
" "test1.png" -quiet
Code: Select all
./convert.exe -auto-orient -density 72 -units PixelsPerInch test1.pdf[0] -thumbnail 350x350> -profile "IccProfiles\sRGB-IEC61966-2.1.icc" -flatten -verbose test1.jpg