On Thu, 11 Jul 2002, John Levon wrote:
> > By default a converter PNG->EPS is defined. Since I defined an EPS->PS
> > converter, Lyx then converted PNG->EPS->PS and failed to load the image
> > (see previous message). So I removed the PNG->EPS converter, so that the
> > PNG->XPM get used. However, the images still didn't get loaded. "lyx -dbg
> > graphics" shows that lyx converts PNG->XPM->EPS->PS! Lyx _can_ load xpm
> > directly and does so, if I delete the EPS->PS converter.
> > This is minor once one knows what happens. There are always ways to work
> > around this, defining only the right converters. But it still seems odd.
> 
> You must have made a mistake somewhere, I think. I just tested 1.2.1cvs
> and it converted my png to xpm directly, and loaded it via the xforms
> image loader

Do you have a xpm->eps converter defined? I don't remember why I defined
that, but that is not the point. My point was that I would expect the
shortest route to be chosen.
Here is the output of lyx -dbg graphics for the case I mentioned:

Attempting to convert image file: ~/lyxdocs/these/images/chap1_neurone.png
with recognised extension: png.
Scanstring: PNG
Recognised Fileformat: png
Scanstring: PNG
Recognised Fileformat: png

        The file contains png format data.

The image loader can load the following directly:
Windows/OS2 BMP file, extension "bmp"
NASA/NOST FITS, extension "fits"
CompuServ GIF, extension "gif"
JPEG/JFIF format, extension "jpg"
Portable Pixmap, extension "ppm"
Portable Graymap, extension "pgm"
Portable Bitmap, extension "pbm"
PostScript, extension "ps"
SGI Iris, extension "sgi"
Tag Image File Format, extension "tif"
X11 Bitmap, extension "xbm"
X Window Dump, extension "xwd"
XPM format, extension "xpm"

Of these, LyX recognises the following formats:
gif, jpg, ps, xpm

Converting it to ps format.
Conversion script:

#!/bin/sh
infile='/home/jan/lyxdocs/these/images/chap1_neurone.png'
infile_base='/home/jan/lyxdocs/these/images/chap1_neurone'
outfile='/tmp/lyx_tmpdir17752l8QsWP/gconvert0177523rZhgm.xpm'

convert ${infile} ${outfile}

if [ $? -ne 0 ]; then
        'rm' -f ${outfile}
        exit 1
fi

if [ ! -f ${outfile} ]; then
        if [ -f ${outfile}.0 ]; then
                'mv' -f ${outfile}.0 ${outfile}
                'rm' -f ${outfile}.?
        else
                exit 1
        fi
fi

infile='/tmp/lyx_tmpdir17752l8QsWP/gconvert0177523rZhgm.xpm'
infile_base='/tmp/lyx_tmpdir17752l8QsWP/gconvert0177523rZhgm'
outfile='/tmp/lyx_tmpdir17752l8QsWP/gconvert0177523rZhgm.eps'

convert ${infile} ${outfile}

if [ $? -ne 0 ]; then
        'rm' -f ${outfile}
        exit 1
fi

if [ ! -f ${outfile} ]; then
        if [ -f ${outfile}.0 ]; then
                'mv' -f ${outfile}.0 ${outfile}
                'rm' -f ${outfile}.?
        else
                exit 1
        fi
fi

'rm' -f ${infile}

infile='/tmp/lyx_tmpdir17752l8QsWP/gconvert0177523rZhgm.eps'
infile_base='/tmp/lyx_tmpdir17752l8QsWP/gconvert0177523rZhgm'
outfile='/tmp/lyx_tmpdir17752l8QsWP/gconvert0177523rZhgm.ps'

gs -q -dNOPAUSE -dSAFER -dBATCH -sDEVICE=pswrite -sOutputFile=${outfile}
${infile}

if [ $? -ne 0 ]; then
        'rm' -f ${outfile}
        exit 1
fi

if [ ! -f ${outfile} ]; then
        if [ -f ${outfile}.0 ]; then
                'mv' -f ${outfile}.0 ${outfile}
                'rm' -f ${outfile}.?
        else
                exit 1
        fi
fi
 
'rm' -f ${infile}
 
fromfile=${outfile}
tofile='/tmp/lyx_tmpdir17752l8QsWP/chap1_neurone17752eXed55.ps'
 
'mv' -f ${fromfile} ${tofile}
if [ $? -ne 0 ]; then
        'cp' -f ${fromfile} ${tofile}
        if [ $? -ne 0 ]; then
                exit 1
        fi
        'rm' -f ${fromfile}
fi
 
 
Image conversion succeeded.
Loading image.
xforms image loader. Status : Converting PS ...
xforms image loader. Status : Loading PostScript
xforms image loader. Error : LoadPS: no page written!
Image loading failed.
xforms image loader. Status : Error Reading

Reply via email to