Truncated JPG with PDF convert

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
Kikkoman
Posts: 3
Joined: 2011-05-02T06:53:23-07:00
Authentication code: 8675308

Truncated JPG with PDF convert

Post by Kikkoman »

Hello all,

I'm experiencing a weird problem with some PDF.

I use Imagick thanks to : echo exec (“convert test.pdf test.jpg”).
That works very well, except with some pdf.

Some images created with pdf thanks to convert, seem being truncated (it generally misses the top of the document).

After some research, I noticed that the problems come from pdf “malformed”.
Indeed, when we look at the pdf (zoom 100%), this one is not visible completely (whereas it takes only one page) and this is what we get when I convert that PDF. (I hope to be clear in my explanations)
So, the result is a jpg which show 80% of the pdf document.

I used some resize tools with convert but that does not works :/

BTW thanks for your help

PS : I'm sorry for my English skill, I'm french :/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Truncated JPG with PDF convert

Post by fmw42 »

Perhaps you should post a link to one of your pdf files so that the IM developers can test it. But if you are getting "malformed" errors, then I suspect it is in the PDF or tool that created it and not in ImageMagick.
Kikkoman
Posts: 3
Joined: 2011-05-02T06:53:23-07:00
Authentication code: 8675308

Re: Truncated JPG with PDF convert

Post by Kikkoman »

You're right, and I forgot to tell the release : ImageMagick-6.2.8

Here is a pdf "malformed" : http://pdfcast.org/pdf/test-137

Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Truncated JPG with PDF convert

Post by fmw42 »

Kikkoman wrote:You're right, and I forgot to tell the release : ImageMagick-6.2.8

Here is a pdf "malformed" : http://pdfcast.org/pdf/test-137

Thanks!

convert test-137.pdf test-137.jpg

It works perfectly fine for me under IM 6.6.9.7 Q16 Mac OSX Tiger and Ghostscript 9

I suspect your version of IM is too old and so many things have been improved. Your IM is over 400 versions old. It might also be your version of Ghostscript that needs upgrading. What version of Ghostscript are you using as IM uses gs to deal with pdf file, if I am not mistaken.
Kikkoman
Posts: 3
Joined: 2011-05-02T06:53:23-07:00
Authentication code: 8675308

Re: Truncated JPG with PDF convert

Post by Kikkoman »

Unfortunately, it's the last release for CentOS 5.6 :/
(Ghostscript 8 - ImageMagick-6.2.8 ), so I can't fix that bug...

I had to search another solution, however, thank you very much for your answer, it helped a lot!
Post Reply