Page 1 of 1

regression - convert fails when convert pdf to png

Posted: 2011-12-20T15:30:33-07:00
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.

Re: regression - convert fails when convert pdf to png

Posted: 2011-12-20T16:02:49-07:00
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.

Re: regression - convert fails when convert pdf to png

Posted: 2011-12-20T16:14:56-07:00
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.

Re: regression - convert fails when convert pdf to png

Posted: 2011-12-20T18:18:46-07:00
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

Re: regression - convert fails when convert pdf to png

Posted: 2011-12-20T18:28:37-07:00
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.

Re: regression - convert fails when convert pdf to png

Posted: 2011-12-20T18:34:31-07:00
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.