Page 1 of 1

regression bug when converting PDF images to PNG

Posted: 2009-11-05T18:57:19-07:00
by donovaly
When I convert this PDF image
http://fkurth.de/uwest/bugreports/Resis ... etwork.pdf
to another format like a PNG using ImageMagick 6.5.7-3 on Windows XP:

Code: Select all

convert -define pdf:use-cropbox=true pdf:Resistance-Network.pdf png:testa.png
I get these errors:

**** Page has no /MediaBox attribute. Using the current page size.
Error: /stackunderflow in --index--
Operand stack:
--dict:6/6(L)-- 595.0 842.0 3
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval--
Dictionary stack:
--dict:1160/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:285/300(ro)(G)-- --dict:21/25(L)-- --dict:2/6(L)--

When I use ImageMagick 6.5.5-0, I don't get this error. The used PDF file has of course a Mediabox:
/MediaBox [ 0 0 252.422638 249.65715 ]

Re: regression bug when converting PDF images to PNG

Posted: 2009-11-05T19:11:47-07:00
by magick
Post a bug to the Ghostscript bug forum. ImageMagick uses this Ghostscript command line which shows the bug is in Ghostscript (or in the PDF):
  • gs -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dUseCropBox "-sOutputFile=Resistance-Network.pnm" Resistance-Network.pdf
    **** Page has no /MediaBox attribute. Using the current page size.
    Error: /stackunderflow in --run--
    Operand stack:
    --dict:6/6(L)-- 612.0 792.0 3
    Execution stack:
    %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval--
    Dictionary stack:
    --dict:1157/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:285/300(ro)(G)-- --dict:21/25(L)-- --dict:2/6(L)--
    Current allocation mode is local
    GPL Ghostscript 8.70: Unrecoverable error, exit code 1

Re: regression bug when converting PDF images to PNG

Posted: 2009-11-06T06:51:57-07:00
by donovaly
magick wrote:Post a bug to the Ghostscript bug forum. ImageMagick uses this Ghostscript command line which shows the bug is in Ghostscript (or in the PDF):
Thanks Magick, it is indeed a regression bug in GS 8.70, in GS 8.65, it works:
http://bugs.ghostscript.com/show_bug.cgi?id=690676