LyX 2.3 and 2.4 have troubles displaying EPS images

Thibaut Cuvelier tcuvelier at lyx.org
Wed Feb 9 20:06:40 UTC 2022


On Wed, 9 Feb 2022 at 19:49, Enrico Forestieri <forenr at lyx.org> wrote:

> 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.
>

If there is no counter-argument against this, I believe it would be the
easiest solution overall. Otherwise, LyX could look after -1, -2 files,
show one of them arbitrarily (say, the first one), and display a message to
the user ("This image file contains several images, only the first one is
being displayed"), but I'm not sure that would bring any value to the user
(unless they have excellent knowledge of EPS, which is not the majority, I
guess).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220209/e14ed802/attachment.html>


More information about the lyx-devel mailing list