LyXLyx has stopped displaying pdf image previews

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Hypolitusk
Posts: 3
Joined: Fri Mar 04, 2016 6:11 am

Lyx has stopped displaying pdf image previews

Post by Hypolitusk »

LyX version 2.1.4
Windows 7 64 bit.

LyX has stopped displaying previews of Adobe Illustrator/PDF/EPS images embedded in my files. They still appear in the final PDF without problems. I haven't used Lyx for a couple of months and everything worked then, but opening it today, no previews! I don't think I've done anything in the last few months that would mess anything up, but who knows.

I spent a few hours on the internet trying to work out what the problem is, and when everything failed I completely reinstalled Lyx (including resetting all the user settings) but the problem remains.

I've set up a small test document that contains only a single embedded image. When I run Lyx in debugging mode from the command line (i.e. "Lyx -dbg Graphics") and open the test file, I get the following output.

It looks like it recognises the image as PDF6, but then fails to convert it (several times). Does anyone have any idea what the problem is?
04:44:04.489: Opening document I:\Temp Files\newfile1.lyx...
04:44:04.621: Document I:\Temp Files\newfile1.lyx opened.
04:44:04.631: (file-open I:/Temp Files/newfile1.lyx)..\..\src\Format.cpp (392): filetools(getFormatFromContents)
File type not recognised before EOF!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (394): Recognised Fileformat: latex
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (392): filetools(getFormatFromContents)
File type not recognised before EOF!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (392): filetools(getFormatFromContents)
File type not recognised before EOF!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (394): Recognised Fileformat: latex
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (392): filetools(getFormatFromContents)
File type not recognised before EOF!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\src\Format.cpp (394): Recognised Fileformat: latex
..\..\src\Format.cpp (493): will guess format from file extension: lyx -> lyx
..\..\src\Format.cpp (392): filetools(getFormatFromContents)
File type not recognised before EOF!
..\..\src\Format.cpp (399): filetools(getFormatFromContents)
Couldn't find a known format!
..\..\..\src\insets\InsetGraphics.cpp (145): Token: 'filename'
..\..\..\src\insets\InsetGraphics.cpp (145): Token: '\end_inset'
..\..\src\Format.cpp (394): Recognised Fileformat: pdf6
..\..\..\src\graphics\GraphicsCacheItem.cpp (379): [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file: I:/Temp Files/Temp.ai
with displayed filename: I:\Temp Files\Temp.ai
..\..\src\Format.cpp (394): Recognised Fileformat: pdf6
..\..\..\src\graphics\GraphicsCacheItem.cpp (386):
The file contains pdf6 format data.
..\..\..\..\src\frontends\qt4\GuiApplication.cpp (215):
The image loader can load the following directly:

..\..\..\..\src\frontends\qt4\GuiApplication.cpp (222): bmp,
..\..\..\..\src\frontends\qt4\GuiApplication.cpp (222): pbm,
..\..\..\..\src\frontends\qt4\GuiApplication.cpp (222): pgm,
..\..\..\..\src\frontends\qt4\GuiApplication.cpp (222): png,
..\..\..\..\src\frontends\qt4\GuiApplication.cpp (222): ppm,
..\..\..\..\src\frontends\qt4\GuiApplication.cpp (222): xbm,
..\..\..\..\src\frontends\qt4\GuiApplication.cpp (222): xpm,
..\..\..\src\graphics\GraphicsCache.cpp (91): LyX recognises the following image formats:
..\..\..\src\graphics\GraphicsCache.cpp (98): bmp
..\..\..\src\graphics\GraphicsCache.cpp (97): ,
..\..\..\src\graphics\GraphicsCache.cpp (98): pbm
..\..\..\src\graphics\GraphicsCache.cpp (97): ,
..\..\..\src\graphics\GraphicsCache.cpp (98): pgm
..\..\..\src\graphics\GraphicsCache.cpp (97): ,
..\..\..\src\graphics\GraphicsCache.cpp (98): png
..\..\..\src\graphics\GraphicsCache.cpp (97): ,
..\..\..\src\graphics\GraphicsCache.cpp (98): ppm
..\..\..\src\graphics\GraphicsCache.cpp (97): ,
..\..\..\src\graphics\GraphicsCache.cpp (98): xbm
..\..\..\src\graphics\GraphicsCache.cpp (97): ,
..\..\..\src\graphics\GraphicsCache.cpp (98): xpm
..\..\..\src\graphics\GraphicsCache.cpp (100):

..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to bmp
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pbm
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pgm
..\..\..\src\graphics\GraphicsLoader.cpp (115): LoaderQueue: waking up
..\..\..\src\graphics\GraphicsCacheItem.cpp (379): [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file: I:/Temp Files/Temp.ai
with displayed filename: I:\Temp Files\Temp.ai
..\..\src\Format.cpp (394): Recognised Fileformat: pdf6
..\..\..\src\graphics\GraphicsCacheItem.cpp (386):
The file contains pdf6 format data.
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to bmp
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pbm
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pgm
..\..\..\src\graphics\GraphicsCacheItem.cpp (379): [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file: I:/Temp Files/Temp.ai
with displayed filename: I:\Temp Files\Temp.ai
..\..\src\Format.cpp (394): Recognised Fileformat: pdf6
..\..\..\src\graphics\GraphicsCacheItem.cpp (386):
The file contains pdf6 format data.
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to bmp
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pbm
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pgm
..\..\..\src\insets\InsetGraphics.cpp (754): insetgraphics::latex: Filename = I:/Temp Files/Temp.ai
..\..\..\src\insets\InsetGraphics.cpp (774): Message = ""
..\..\..\src\insets\InsetGraphics.cpp (789): Opts =
..\..\..\src\insets\InsetGraphics.cpp (796): Before = \includegraphics
after =
..\..\..\src\insets\InsetGraphics.cpp (808): InsetGraphics::latex outputting:
\includegraphics{Temp}
..\..\..\src\insets\InsetGraphics.cpp (754): insetgraphics::latex: Filename = I:/Temp Files/Temp.ai
..\..\..\src\insets\InsetGraphics.cpp (774): Message = ""
..\..\..\src\insets\InsetGraphics.cpp (789): Opts =
..\..\..\src\insets\InsetGraphics.cpp (796): Before = \includegraphics
after =
..\..\..\src\insets\InsetGraphics.cpp (808): InsetGraphics::latex outputting:
\includegraphics{Temp}
..\..\..\src\graphics\GraphicsCacheItem.cpp (379): [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file: I:/Temp Files/Temp.ai
with displayed filename: I:\Temp Files\Temp.ai
..\..\src\Format.cpp (394): Recognised Fileformat: pdf6
..\..\..\src\graphics\GraphicsCacheItem.cpp (386):
The file contains pdf6 format data.
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to bmp
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pbm
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pgm
..\..\..\src\insets\InsetGraphics.cpp (754): insetgraphics::latex: Filename = I:/Temp Files/Temp.ai
..\..\..\src\insets\InsetGraphics.cpp (774): Message = ""
..\..\..\src\insets\InsetGraphics.cpp (789): Opts =
..\..\..\src\insets\InsetGraphics.cpp (796): Before = \includegraphics
after =
..\..\..\src\insets\InsetGraphics.cpp (808): InsetGraphics::latex outputting:
\includegraphics{Temp}
..\..\..\src\graphics\GraphicsLoader.cpp (90): LoaderQueue: 1 items in the queue
..\..\..\src\graphics\GraphicsCacheItem.cpp (409): Converting it to format.
..\..\..\src\graphics\GraphicsCacheItem.cpp (379): [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file: I:/Temp Files/Temp.ai
with displayed filename: I:\Temp Files\Temp.ai
..\..\src\Format.cpp (394): Recognised Fileformat: pdf6
..\..\..\src\graphics\GraphicsCacheItem.cpp (386):
The file contains pdf6 format data.
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to bmp
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pbm
..\..\..\src\graphics\GraphicsCacheItem.cpp (341): Unable to convert from pdf6 to pgm
..\..\..\src\graphics\GraphicsConverter.cpp (128): Converter c-tor:
from_file: I:/Temp Files/Temp.ai
to_file_base: I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/CacheItem.PuhyXszo5636
from_format: pdf6
to_format: png
..\..\..\src\graphics\GraphicsConverter.cpp (273): build_script ...
..\..\..\src\graphics\GraphicsConverter.cpp (398): ready!
..\..\..\src\graphics\GraphicsConverter.cpp (143): Conversion script
--------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, shutil, sys

def unlinkNoThrow(file):
''' remove a file, do not throw if an error occurs '''
try:
os.unlink(file)
except:
pass

infile = "I:/Temp Files/Temp.ai"
outfile = "I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/gconvertsj5636.ai"
shutil.copy(infile, outfile)
os.chdir("I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/")
infile = "I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/gconvertsj5636.ai"
infile_base = "I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/gconvertsj5636"
outfile = "I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/gconvertsj5636.eps"
outdir = os.path.dirname(outfile)

if os.system(r'pdf2ps ' + '"' + infile + '"' + ' ' + '"' + 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)

if infile != outfile:
unlinkNoThrow(infile)

infile = "I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/gconvertsj5636.eps"
infile_base = "I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/gconvertsj5636"
outfile = "I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/gconvertsj5636.png"
outdir = os.path.dirname(outfile)

if os.system(r'convert ' + '"' + infile + '"' + ' ' + '"' + 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)

if infile != outfile:
unlinkNoThrow(infile)

fromfile = outfile
tofile = "I:/Temp Files/System/SimonKane/lyx_tmpdir.HNbHddvy5636/CacheItem.PuhyXszo5636.png"

try:
os.rename(fromfile, tofile)
except:
try:
shutil.copy(fromfile, tofile)
except:
sys.exit(1)
unlinkNoThrow(fromfile)

--------------------------------------

..\..\..\src\support\ForkedCalls.cpp (582): ForkedCallQueue: waking up
..\..\..\src\graphics\GraphicsLoader.cpp (126): LoaderQueue: I'm going to sleep
..\..\..\src\support\ForkedCalls.cpp (591): ForkedCallQueue: I'm going to sleep
..\..\..\src\graphics\GraphicsCacheItem.cpp (264): Image conversion failed.
..\..\..\src\graphics\GraphicsCacheItem.cpp (274): Unable to find converted file!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Lyx has stopped displaying pdf image previews

Post by scottkosty »

I have no idea what's going on. I've seen strange problems like this happen on Windows. If you post an example document, I can see if I can reproduce the problem on Ubuntu.

You could try 2.2.0beta2. There have been improvements to the preview code. You can download the installer here:
ftp://ftp.lyx.org/pub/lyx/devel/lyx-2.2/2.2.0-latest
The usual warnings apply for a beta release (backup your work!).
Hypolitusk
Posts: 3
Joined: Fri Mar 04, 2016 6:11 am

Lyx has stopped displaying pdf image previews

Post by Hypolitusk »

Hi Scott,
scottkosty wrote:If you post an example document, I can see if I can reproduce the problem on Ubuntu.
That wouldn't help. It's not that I can't create new documents where the previews don't work, it's that all my documents (including old ones that I know are fine because LyX didn't have a problem with them a couple of months ago) now won't have image previews displayed. They all just show 'Error Converting to Loadable Format'.

Everything similar I found online indicates that it's a problem with the File-Handling preferences, but when I couldn't get any of the proposed solutions to work, I completely reinstalled LyX, but it didn't fix the problem. So it's obviously something to do with my machine, but I've no idea what changed in the last couple of months that could cause a problem. I was hoping that someone might be able to spot something in the debug output.
scottkosty wrote:You could try 2.2.0beta2. There have been improvements to the preview code. You can download the installer here:
ftp://ftp.lyx.org/pub/lyx/devel/lyx-2.2/2.2.0-latest
The usual warnings apply for a beta release (backup your work!).
That's not a bad idea. I'll give it a go.

Thanks.
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Lyx has stopped displaying pdf image previews

Post by scottkosty »

Hypolitusk wrote:
That's not a bad idea. I'll give it a go.

Thanks.
Great, if you have any feedback when testing, please let us know at lyx-devel@lists.lyx.org
Hypolitusk
Posts: 3
Joined: Fri Mar 04, 2016 6:11 am

Re: Lyx has stopped displaying pdf image previews

Post by Hypolitusk »

OK, I installed the latest beta, but the problem is still there, i.e. even with a clean installation (including MiKTeX), files that used to load without any problems, now will load and generate correct output files, but won't show image previews inside LyX.

Are there any parts of the system outside of LyX that LyX depends on, e.g. image processing libraries, pdf previewing libraries?
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Lyx has stopped displaying pdf image previews

Post by scottkosty »

Hypolitusk wrote: Are there any parts of the system outside of LyX that LyX depends on, e.g. image processing libraries, pdf previewing libraries?
Yes but on Windows I have no idea how to look further into this. If you happen to have access to Ubuntu and have the same problem then I could help. Otherwise consider sending an email to the list.
Post Reply