On 03/17/2013 05:44 AM, Scott Kostyshak wrote:
On Thu, Mar 14, 2013 at 11:20 AM, Vasek Smidl <vasek.sm...@gmail.com> wrote:
Hi all,
I have run into the image loading problem discussed e.g.
http://tex.stackexchange.com/questions/80186/graphics-preview-in-lyx-gives-
error-loading-file-into-memory
Are you also using Kubuntu also? Which version? Did this happen all of
a sudden? Is this a fresh (K)ubuntu install?
I tested the most recent ubuntu daily packages from ppa and the problem still
exists in both lyx 2.0.6dev and 2.1.0dev.
I am running ubuntu precise.
Thanks for doing this. This is helpful for a bug report.
In my case it is indeed a caching problem. When I delete the cache the files are
loaded correctly. Below is a typical output of the -dbg graphics.
Does anyone else see this problem?
Is it general problem or only distro specific?
I do not have this problem on Ubuntu 12.04 or 12.10.
support/FileName.cpp (945): Recognised Fileformat: pdf
graphics/GraphicsCacheItem.cpp (378): [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file:
/home/smidl/work/zcu/kyber_skupina/vs/MPMF/rbmpf.pdf
with displayed filename: ~/work/zcu/kyber_skupina/vs/MPMF/rbmpf.pdf
support/FileName.cpp (945): Recognised Fileformat: pdf
graphics/GraphicsCacheItem.cpp (385):
The file contains pdf format data.
graphics/GraphicsCacheItem.cpp (397): No conversion needed (file in file
cache)!
graphics/GraphicsCacheItem.cpp (293): Loading image.
frontends/qt4/GuiImage.cpp (90): Unable to open image
graphics/GraphicsCacheItem.cpp (299): Image loading failed.
graphics/GraphicsCacheItem.cpp (408): Converting it to format.
The code is just:
bool GuiImage::load()
{
if (!original_.load(fname_)) {
LYXERR(Debug::GRAPHICS, "Unable to open image");
return false;
}
return true;
and original_ is a QImage, so the image is failing in Qt.
It would be nice if we could figure out why "Image loading failed."
Can LyX not find the file? Is it in the wrong format? Not correct
permissions?
We could add some debug code into GraphicsCacheItem::imageLoad().
Really, it'd be nice to have a bit more code there anyway. E.g., to tell
us the filename we are trying to load.
Vasek, you might just try: file ~/.lyx/cache/*, to see what the system
thinks is there.
Can you compile LyX yourself?
Richard
A wild guess, since I've never seen this before, is that something
could be wrong with the Qt libraries on your (K)ubuntu, which I think
are responsible for trying to load the image. You could try purging
and re-installing.
If you wanted to try to debug some more, the problem (although maybe
not the root problem), as indicated in the debug output you gave, is
around graphics/GraphicsCacheItem.cpp (299):
bool success = image_->load(file_to_load_);
string const text = success ? "succeeded" : "failed";
LYXERR(Debug::GRAPHICS, "Image loading " << text << '.');
You could set a break point there and poke around.
Best,
Scott