Created attachment 8579 [details] failing pdf input Environment ------------ Tested against ghostscript 9-04, 9-05, latest version from master branch (git repo) Invocation ---------- ghostscript -q -dBATCH -dNOPAUSE -sDEVICE=jpeg -r200x200 -sOutputFile=page_%02d.jpg pg_0002.pdf Output (looping message) ------------------------ **** File has unbalanced q/Q operators (too many Q's) **** Expected output --------------- Jpeg file is not created as it should be, program does not halt.
The problem is caused by an incorrect stitching function in the PDF file and a problem in the error handler. Verifying the arguments of the stitching function should be not particularly difficult.
Created attachment 8692 [details] File that causes infinite loop while trying to render the first page into jpg Today I have had the same problem. I'm attaching here the PDF that made gs enter into an infinite loop. I was running: gs -sDEVICE=jpeg -sOutputFile=- -dFirstPage=1 -dLastPage=1 -r150 -dBATCH -dNOPAUSE -q Triptico-guifi1A.pdf Thanks for your work!
The problem reported in the comment 2 is now tracked as a bug 693134. It is completely unrelated to the PDF front end issues. BTW, there's no loop, just very slow rendering.
Created attachment 8696 [details] Simplified sample file
The infinite loop has been fixed earlier. This fix moves shading dictionary construction into a stopped context. New code just drops a shading that cannot be constructed or rendered instead of aborting the whole stream run. It's been committed as a rev. 339fcbd26065c2771a33ea8c805ff70bd097684a