Created attachment 7607 [details] Problematic PDF File I'm attempting to set up Ghostscript to allow ImageMagick to convert PDFs into JPGs and have run into an issue with certain PDFs I have (example attached). I'm running Ghostscript 9.02, compiled today. I don't encounter this issue with test PDFs I've created, but at the same time I'm able to open the problematic PDFs in a variety of PDF readers. Here's the command I'm running to test and the error gs is throwing: [root@274632-web1 gs]# gs -r20 -q -dNOPAUSE -dBATCH -sDEVICE=jpeg -sOutputFile=PV0000093506.jpg PV0000093506.pdf Error: /undefined in --run-- Operand stack: --dict:7/16(L)-- false --dict:13/20(L)-- --dict:1/1(L)-- --nostringval-- FlateDecode --dict:1/1(L)-- 0 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1894 1 3 %oparray_pop 1893 1 3 %oparray_pop 1877 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 6 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- 2318189 --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- Dictionary stack: --dict:1154/1684(ro)(G)-- --dict:1/20(G)-- --dict:82/200(L)-- --dict:82/200(L)-- --dict:108/127(ro)(G)-- --dict:295/300(ro)(G)-- --dict:23/30(L)-- --dict:6/8(L)-- --dict:24/40(L)-- --dict:1/1(ro)(G)-- --dict:8/18(L)-- Current allocation mode is local Last OS error: 2 GPL Ghostscript 9.02: Unrecoverable error, exit code 1 Let me know if more information is necessary.
For me current (release) build gets an undefined in --get--, setting -dPDFDEBUG shows object 62 0 (an Image XObject with ImageMask true) as the culprit. If I use a debug build I instead get : **** Error reading a content stream. The page may be incomplete. **** File did not complete the page properly and may be damaged. And a partially blank page, missing the large image. If I decompress the file using MuPDF and render it then it works without problems. I suspect that either there is a problem decompressing the data, or possibly the compressed stream length is incorrect, leading to GS running off the end of the data. One for Alex.
I just verified the error on a completely fresh install of the base OS (RHEL 5.6). I received the exact same error after compiling the most recent release of GS.
We don't yet handle the case when the image has multiple decoding filters and one of them is JPXDecode.
P2 for missing required functionality.
Fix a bug in /JPXDecode filter handler that generated bad /DecodeParms when /JPXDecode filter was used in a /Filter array. Remove some obsolete code related to /JPXDecode. See http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=66700ec35f74a6e049ed6654283418a6d23bfb3e