regression - convert fails when convert pdf to png

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
goebbe
Posts: 5
Joined: 2011-12-13T05:49:28-07:00
Authentication code: 8675308

regression - convert fails when convert pdf to png

Post by goebbe »

The following issue has been reported on the bug-tracker of LyX and is likely to
be a problem with recent versions of IM:

Using recent versions of IM (e.g. 6.7.4) on a Win7 (64-bit) in order to
convert pdf-files to png (and other formats) lead to errors in
many cases.
Older versions of IM (e.g. 6.7.2-1) use to convert these pdf-images just fine.

A LyX developer reported that the convert works for roughly half of his pdf-images and fail for the rest.
The original bug report and example files can be found here:
http://www.lyx.org/trac/ticket/7939

The following type of convert is typically used in LyX:
convert -define pdf:use-cropbox=true -depth 8 -flatten "pdf:testgraph.pdf" "png:testgraph.png"

Please let me know if I can provide anything else.
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Re: regression - convert fails when convert pdf to png

Post by donovaly »

I can confirm the bug. (This is independent of 32bit or 64bit Windows.) With IM 6.7.3-8 and 6.7.4-0 I get

Code: Select all

>convert testgraph.pdf test.png
convert.exe: no decode delegate for this image format `testgraph.pdf' @ error/constitute.c/ReadImage/532.
convert.exe: missing an image filename `test.png' @ error/convert.c/ConvertImage
Command/3016.
With IM 6.7.2-1 it works without problems.

Here is the testfile:
http://www.lyx.org/trac/raw-attachment/ ... tgraph.pdf

I have Ghostscript 9.04 installed.
goebbe
Posts: 5
Joined: 2011-12-13T05:49:28-07:00
Authentication code: 8675308

Re: regression - convert fails when convert pdf to png

Post by goebbe »

@donovaly: Your issue seem to be different. IM cannot find GS in your case. So with your install convert should fail for all pdfs (this requires GS) - and not only for some pdfs, as reported above.
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Re: regression - convert fails when convert pdf to png

Post by donovaly »

The bug is that the

-define pdf:use-cropbox=true

switch does not work anymore.
Using
convert -define pdf:use-cropbox=true -depth 8 -flatten "pdf:testgraph.pdf" "png:testgraph.png"
fails but
convert -depth 8 -flatten "pdf:testgraph.pdf" "png:testgraph.png"
works.

This regression has been introduced after IM 6.7.2
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

Re: regression - convert fails when convert pdf to png

Post by donovaly »

goebbe wrote:@donovaly: Your issue seem to be different. IM cannot find GS in your case. So with your install convert should fail for all pdfs (this requires GS) - and not only for some pdfs, as reported above.
Yes, this was my fault. I had a broken installation.
That a part of my PDFs worked had other reasons. The reason of this bug is what I described in my last commit.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: regression - convert fails when convert pdf to png

Post by magick »

We can reproduce the problem and have a patch. Look for a new release of the ImageMagick Windows binaries within the next week. Thanks.
Post Reply