Lyx can not show pdf graphics due to bug in imagemagick

Bug #487637 reported by nick
This bug report is a duplicate of:  Bug #502049: Gs bug crash imagemagick. Edit Remove
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ImageMagick
New
Undecided
Unassigned
imagemagick (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: imagemagick

Recently I moved from 9.04 to 9.10 and found that lyx does not show pdf graphics anymore. The "Error converting loadable format" messages are displayed instead pdf graphics.

Reproducing this bug is very simple, just open lyx, create new file and insert pdf graphics.

I found that LyX uses 'convert' command from imagemagick to convert pdf to ppm file. This command is called from /usr/share/lyx/scripts/convertDefault.py script. It is called with following arguments:

convert -define pdf:use-cropbox=true -depth 8 -flatten "pdf:foo.pdf" "ppm:foo.ppm"

This command line does not work on Jaunty:

 nmn@laptop:~/temp$ convert -define pdf:use-cropbox=true -depth 8 -flatten "pdf:foo.pdf" "ppm:foo.ppm"
   **** 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:1159/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
convert: Postscript delegate failed `foo.pdf': No such file or directory @ pdf.c/ReadPDFImage/612.
convert: missing an image filename `ppm:foo.ppm' @ convert.c/ConvertImageCommand/2775.
nmn@laptop:~/temp$

The problem is in "-define pdf:use-cropbox=true" option. Without this option everything works Ok. Workaround is quite simple and may be done on per-user basis, whithout root privileges. You can overwrite stock convertDefault.py by placing your own script with same name into ~/.lyx/scripts directory. I attach fixed convertDefault.py that works for me.

Revision history for this message
broucaries (roucaries-bastien+bugs) wrote :

Verified on debian version

Changed in imagemagick (Ubuntu):
status: New → Confirmed
Revision history for this message
broucaries (roucaries-bastien+bugs) wrote :
Revision history for this message
broucaries (roucaries-bastien+bugs) wrote :

According to upstream it is a bug in ghostscript !

Therefore add a blocking bug on gs.

Thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers