Angus,

Thank you for your advice.

I'm using version 1.3.5 (actually it's CJK-Lyx-1.3.5 but I don't think CJK patch is related to this problem) and I'm using the temporary directory (/tmp).

Looking at the debug information of 'lyx -dbg graphics', it seems that the created script for the conversion of image does not specify the output file. Here is the content of the script (+debug info):

PreviewLoader::finishedInProgress(1): processing failed for /usr/local/share/lyx/scripts/lyxpreview2ppm.py /tmp/lyx_tmpdir79676GFtWvQ/lyx_tmpbuf0/0lyxpreview.tex 109 ppm
Recognised Fileformat: eps
[GrahicsCacheItem::convertToDisplayFormat]
        Attempting to convert image file: /hoge/hoge.eps
        with displayed filename: /hoge/hoge.eps
Recognised Fileformat: eps

        The file contains eps format data.
Unable to convert from eps to bmp
Unable to convert from eps to gif
Unable to convert from eps to jpg
Unable to convert from eps to pbm
Unable to convert from eps to pgm
Unable to convert from eps to png
        Converting it to ppm format.
Converter c-tor:
        from_file:      /hoge/hoge.eps
        to_file_base: /tmp/lyx_tmpdir79676GFtWvQ/Diamond82-179676XOhtkh
        from_format:  eps
        to_format:    ppm
build_script ... ready!
        Conversion script:
--------------------------------------
#!/bin/sh
infile='/hoge/hoge.eps'
infile_base='/hoge'
outfile='/tmp/lyx_tmpdir79676GFtWvQ/gconvert079676yHQsea.ppm'

pstopnm "${infile}" ||
{
        'rm' -f "${outfile}"
        exit 1
}

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

fromfile="${outfile}"
tofile='/tmp/lyx_tmpdir79676GFtWvQ/Diamond82-179676XOhtkh.ppm'

'mv' -f "${fromfile}" "${tofile}" ||
{
        'cp' -f "${fromfile}" "${tofile}" ||
        {
                exit 1
        }
        'rm' -f "${fromfile}"
}
--------------------------------------
pstopnm: Writing ppmraw file
Image conversion failed.
Unable to find converted file!

I'm using netpbm-10.26.14 on FreeBSD-5.4 and the man page of netpbm says:

If you use the -stdout  option, pstopnm outputs images of all the pages
as a multi-image file to Standard Output.  Otherwise,  pstopnm  creates
one file for each page in the Postscript document.  The files are named
as follows: If the input file is named psfile.ps, the name of the files
will  be  psfile001.ppm,  psfile002.ppm,  etc.

So, it seems the phenomenon I observed is a natural consequence in my current environment.
Do I need to modify lyxpreview2ppm.py?

Angus Leeming wrote:

Koji Yokota wrote:

LyX has been failing to show image preview when I insert graphics in
LyX document from some time ago.

LyX simply shows a box which says "failed to convert image" at the
place I inserted graphics. However, LyX seems successfully
converting the image in the same directory as the document and
image. For example, when the file name of the inserted image is
"test.eps", it creates a file "test.eps001.ppm" which is not broken.
So, the problem looks simply LyX cannot correctly find
"test.eps001.ppm".

Can you suggest how to correct the problem? Thank you in advance.

* Could you tell us what version of LyX you are using?

* Are you using a temporary directory? To check:

Using the Qt frontend look in the Paths pane of the Edit->Preferences
dialog.

[x] Use temporary directory [/tmp    ] [Browse...]

Using the XForms frontend look in the Input->Paths tab of the
Edit->Preferences dialog.

Temp dir: [x] [/tmp    ] [Browse...]


I'm very surprised by the generated filenames too.
lyx -dbg graphics
should dump a whole heap of information to the console to help you
diagnose the problem.

Angus



Koji Yokota ([EMAIL PROTECTED])
Department of Economics
Otaru University of Commerce


Reply via email to