On Wed, Feb 09, 2022 at 09:06:40PM +0100, Thibaut Cuvelier wrote: > On Wed, 9 Feb 2022 at 19:49, Enrico Forestieri <for...@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
signature.asc
Description: PGP signature
-- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel