Julio Rojas wrote:
I still have the problem related to LyX unable to render an image on screen. I have a document with a couple of PDF images and LyX shows "Error converting to loadable form".I have installed, as suggested, ImageMagick. Added the $ImageMagick/bin to $PATH, added it to LyX path, tried "convert" from a shell (outside its directory) and it is working, but LyX still keeps telling me that error. The debbuging option shows the following text: Recognised Fileformat: png [GrahicsCacheItem::convertToDisplayFormat] Attempting to convert image file: /tmp/lyx_tmpdir2667fWnF6/lyx_tmpbuf0/0lyxpreview3.png with displayed filename: /tmp/lyx_tmpdir2667fWnF6/lyx_tmpbuf0/0lyxpreview3.png Recognised Fileformat: png The file contains png format data. No conversion needed (from == to)! Loading image. Image loading succeeded. GraphicsImage::getScaledDImensions() params.scale : 100 width : 579 height : 42 Recognised Fileformat: pdf [GrahicsCacheItem::convertToDisplayFormat] Attempting to convert image file: /Users/jcredberry/Desktop/EPF/EPF_Liga_Espanola.pdf with displayed filename: ~/Desktop/EPF/EPF_Liga_Espanola.pdf Recognised Fileformat: pdf The file contains pdf format data. Unable to convert from pdf to bmp Unable to convert from pdf to jpg Unable to convert from pdf to pbm Unable to convert from pdf to pgm Unable to convert from pdf to png Unable to convert from pdf to ppm Unable to convert from pdf to xbm Unable to convert from pdf to xpm Converting it to ppm format. Converter c-tor: from_file: /Users/jcredberry/Desktop/EPF/EPF_Liga_Espanola.pdf to_file_base: /tmp/lyx_tmpdir2667fWnF6/CacheItem266dy40S8 from_format: pdf to_format: ppm build_script ... No converter defined! I use convertDefault.pypython "/Applications/LyX.app/Contents/Resources/scripts/convertDefault.py"pdf:' + '"' + infile + '"' + ' ppm:' + '"' + outfile + '"' + ' ready! Conversion script: -------------------------------------- #!/usr/bin/env python import os, shutil, sys def unlinkNoThrow(file): ''' remove a file, do not throw if an error occurs ''' try: os.unlink(file) except: pass infile = "/Users/jcredberry/Desktop/EPF/EPF_Liga_Espanola.pdf" outfile = "/tmp/lyx_tmpdir2667fWnF6/gconvert02669EIZR3.pdf" shutil.copy(infile, outfile) infile = outfile outfile = "/tmp/lyx_tmpdir2667fWnF6/CacheItem266dy40S8.ppm" if os.system(r'python "/Applications/LyX.app/Contents/Resources/scripts/convertDefault.py" pdf:' + '"' + infile + '"' + ' ppm:' + '"' + outfile + '"' + '') != 0: unlinkNoThrow(outfile) sys.exit(1) if not os.path.isfile(outfile): if os.path.isfile(outfile + '.0'): os.rename(outfile + '.0', outfile) import glob for file in glob.glob(outfile + '.?'): unlinkNoThrow(file) else: sys.exit(1) unlinkNoThrow(infile) fromfile = outfile tofile = "/tmp/lyx_tmpdir2667fWnF6/CacheItem266dy40S8.ppm" try: os.rename(fromfile, tofile) except: try: shutil.copy(fromfile, tofile) except: sys.exit(1) unlinkNoThrow(fromfile) -------------------------------------- ForkedCallQueue: waking up LoaderQueue: I'm going to sleep convert: UnableToOpenBlob `pdf:/tmp/lyx_tmpdir2667fWnF6/gconvert02669EIZR3.pdf': No such file or directory. convert: MissingAnImageFilename `ppm:/tmp/lyx_tmpdir2667fWnF6/CacheItem266dy40S8.ppm'. /Applications/LyX.app/Contents/Resources/scripts/convertDefault.py ERROR Execution of "convert" failed. ForkedCallQueue: I'm going to sleep Image conversion failed. Unable to find converted file! Some new suggestions on this problem???
Do you have Ghostscript installed? ImageMagick uses GS to convert PS, EPS and PDF files.
/Paul
