option "-define pdf:use-cropbox=true" partly broken

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

option "-define pdf:use-cropbox=true" partly broken

Post by donovaly »

- Take a PDF-image in landscape format like this one:
http://fkurth.de/uwest/usti/Bilder/SpannungsTest1.pdf

- convert it to a PNG with IM 6.3.6-3 using this command:

Code: Select all

convert -define pdf:use-cropbox=true SpannungsTest1.pdf test1.png
As result you get an image that is cropped as if it would be in portrait format, see
http://fkurth.de/uwest/usti/Bilder/test1.png

- When you do the same with a PDF-image in portrait format:
http://fkurth.de/uwest/usti/Bilder/SpannungsTest2.pdf
you get a correct result:
http://fkurth.de/uwest/usti/Bilder/test2.png

(Perhaps this bug has been reintroduced?:
viewtopic.php?f=3&t=6206&start=0&st=0&sk=t&sd=a )
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Re: option "-define pdf:use-cropbox=true" partly broken

Post by donovaly »

I forgot to say that I have Ghostscript 8.60 installed (I don't think Ghostscript is the reason.)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: option "-define pdf:use-cropbox=true" partly broken

Post by magick »

We grab the bounding box properly but unlike Postscript we cannot yet determine how to translate the PDF as required by the bounding box (for your image about -50,-50). For Ghostscript we inject the Postscript statement "-50, -50 translate". It may take awhile before we properly fix this problem for PDF.
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Re: option "-define pdf:use-cropbox=true" partly broken

Post by donovaly »

magick wrote:We grab the bounding box properly but unlike Postscript we cannot yet determine how to translate the PDF as required by the bounding box
I don't understand that this is a problem, because in ImageMagick versions from the beginning of this year the cropbox was correctly set independent from the paper orientation.
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Re: option "-define pdf:use-cropbox=true" partly broken

Post by donovaly »

We grab the bounding box properly but unlike Postscript we cannot yet determine how to translate the PDF as required by the bounding box (for your image about -50,-50). For Ghostscript we inject the Postscript statement "-50, -50 translate". It may take awhile before we properly fix this problem for PDF.
I don't know how and if you fixed this by intent, but with ImageMagick 6.3.8-11 this bug is fixed. Maybe due to the changes in ImageMagick 6.3.8-10:
Speed up converting large PDF/PS images when only selecting a few pages (e.g. pdffile.pdf[195-199]).
Post Reply