LyX 2.3 and 2.4 have troubles displaying EPS images

Enrico Forestieri forenr at lyx.org
Wed Feb 9 18:48:57 UTC 2022


On Wed, Feb 09, 2022 at 06:46:39PM +0100, Thibaut Cuvelier wrote:
> 
> The main reason I'm taking this to the dev mailing list is that pdflatex
> doesn't have any problem with this file, while LyX does without any useful
> information for the user. I believe some tool fails when loading the image,
> it would be really nice to tell the user what went wrong (and how they
> might solve the problem).

The problem here is that the postscript file contains two images and
imagemagick converts both of them and appends a count to the file names.
So, LyX expects file.png but imagemagick produces file-1.png and
file-2.png. Hence, LyX thinks imagemagick failed to perform the conversion.

To solve this, you have to edit the EPS->PNG converter and change it from

  magick $$i $$o

to

  magick $$i[0] $$o

if you want the first image, or replace 0 with 1 if you want the second one.

Maybe this setting should be the default one? I am not sure because this
is the first time I see it. Another way to fix the issue would be by
removing the strange header so that the file starts with "%!". I was
able to do that with gvim and then imagemagick produced only one image.

-- 
Enrico


More information about the lyx-devel mailing list