Hello

I added the "echo" line in convertDefault.sh script. The following are the error message that I see:

filetools(getFormatFromContents)
       File type not recognised before EOF!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       File type not recognised before EOF!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       File type not recognised before EOF!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       File type not recognised before EOF!
filetools(getFormatFromContents)
       Couldn't find a known format!
filetools(getFormatFromContents)
       File type not recognised before EOF!
filetools(getFormatFromContents)
       Couldn't find a known format!
Token: 'filename'
Token: '\end_inset'
LoaderQueue: waking up
The font scaling factor is 129.6
LoaderQueue: 1 items in the queue
Recognised Fileformat: eps
[GrahicsCacheItem::convertToDisplayFormat]
       Attempting to convert image file: C:/<path>/test.ps
       with displayed filename: C:\<path>\test.ps
Recognised Fileformat: eps

       The file contains eps format data.
Unable to convert from eps to bmp
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
Unable to convert from eps to ppm
Unable to convert from eps to xbm
Unable to convert from eps to xpm
       Converting it to ppm format.
Converter c-tor:
       from_file:      C:/<path>/test.ps
to_file_base: C:/Documents and Settings/<your id here>/Temp/lyx_tmpdir2744a03372/test2744a03372
       from_format:  eps
       to_format:    ppm
build_script ... ready (edgepath.empty())
       No converter defined! I use convertDefault.sh
sh "C:/LyX/LyX1.4.2/Resources/scripts/convertDefault.sh" "eps:C:/<path>/test.ps" "ppm:C:/Documents and Settings/<your id here>/Temp/lyx_tmpdir2744a03372/test2744a03372.ppm"
ForkedCallQueue: waking up
LoaderQueue: I'm going to sleep
Converting eps:C:/<path>test.ps to ppm:C:/Documents and Settings/<your id here>/Temp/lyx_tmpdir2744a03372/test2744a03372.ppm ...
AFPL Ghostscript 8.14 (2004-02-20)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>

Any clues?

Thank you
Leo

LB wrote:
Hi

When the image does not preview, the last a few lines in the debug window are:
ForkedCallQueue: waking up
LoaderQueue: I'm going to sleep
AFPL Ghostscript 8.14 (2004-02-20)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>

I need to "quit" Ghostscript at this time to get:
convert.exe: no decode delegate for this image format `<file name is here>.ps'.
convert.exe: missing an image filename `ppm:<file name is here>.ppm'.
C:/LyX/LyX1.4.2/Resources/scripts/convertDefault.sh ERROR
Execution of "convert" failed.

Whereas when the image previews ok the last few lines in the debug window are:

ForkedCallQueue: waking up
LoaderQueue: I'm going to sleep
ForkedCallQueue: I'm going to sleep
Image conversion succeeded.
Loading image.
Image loading succeeded.
GraphicsImage::getScaledDImensions()
       params.scale       : 100
       width              : 497
       height             : 404


It appears that "Image conversion succeeded" does not appear when the image does not show in Lyx. It also look like that having the file deep in a long tree of subdirectories contributes to this problem as the same file work fine when placed in C:\ directory.

Why I only have this problem with one particular figure is still very puzzling.


When LyX needs to display your image, it calls the convertDefault.sh script, which in turn calls ImageMagick's convert.exe program to convert test.ps to test.ppm. ImageMagick then uses Ghostscript to read the .ps file. Judging by the fact that Ghostscript "hangs open" until you close it, and the "missing filename" bit later on, it looks to me as if the ImageMagick-to-Ghostscript call might somehow have lost or mangled the file name (?!). There's some relevant output just above the first line you quoted that would help.

If you want to investigate this possibility, try the following. In the LyX Resources\scripts, find convertDefault.sh and open it with a text editor (e.g., notepad). Find the lines

# converts an image from $1 to $2 format
convert -depth 8 "$1" "$2" || {

and insert

echo "Converting $1 to $2 ..."

between them. Then run with -dbg graphics again. You should get output similar to what I got (albeit with different paths):

        No converter defined! I use convertDefault.sh
sh "C:/Program Files/LyX142/Resources/scripts/convertDefault.sh" "eps:C: /Documents and Settings/<your id here>/Desktop/test.ps" "ppm:C:/Temp/lyx_tmpdir5
620a03976/test5620a03976.ppm"
ForkedCallQueue: waking up
LoaderQueue: I'm going to sleep
Converting eps:C:/Documents and Settings/<your id here>/Desktop/test.ps to ppm:C
:/Temp/lyx_tmpdir5620a03976/test5620a03976.ppm ...
ForkedCallQueue: I'm going to sleep
Image conversion succeeded.

Do the file names and paths look right when you do this?

/Paul



Reply via email to