LyX 2.3 and 2.4 have troubles displaying EPS images

Scott Kostyshak skostysh at lyx.org
Wed Feb 9 21:11:33 UTC 2022


On Wed, Feb 09, 2022 at 09:06:40PM +0100, Thibaut Cuvelier wrote:
> 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).

Personally I would prefer a user-friendly error message, along the lines of:

  The .eps file you included, <filename>, contains more than one image.

followed perhaps by instructions on how to extract the one they desire,
or to alternatively change the converter to automatically select the
first image.

I haven't followed the discussion in this thread, but is it common for
programs to create .eps files that have multiple images? I think it
would be helpful to understand the purpose of creating such .eps images
before figuring out to do what them.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220209/d9b4e2a6/attachment-0001.asc>


More information about the lyx-devel mailing list