On Monday 27 October 2003 10:40 pm, Kayvan A. Sylvan wrote:
> > > temp directory when the "Unable to find ..." message is generated.
> > > The path and file name are correct.
> >
> > Good. So we have probably nailed down the problem. The file is
> > generated correctly but LyX itself is unable to understand this
> > 'mixed language' file name 'C:/foo/bar.ppm'.
>
> Maybe it's not LyX, but LaTeX?
In the particular case we're discussing it's not LaTeX. The Win32 version of
LyX is unable to display graphics files on screen if they need to first be
converted to a 'loadable' format. It transpires that there are several bugs
in the code when it comes to Win32 but the primary one is:
LyX calls the files stuff like 'C:/foo/bar.jpg'
It seems like the shell script and ImageMagick can handle this abuse but once
LyX is told that the conversion has succeeded it has code:
void CacheItem::Impl::imageConverted(bool success)
{
file_to_load_ = converter_.get() ?
converter_->convertedFile() : string();
success = !file_to_load_.empty() && IsFileReadable(file_to_load_);
if (!success) {
lyxerr[Debug::GRAPHICS] << "Unable to find converted file!"
<< endl;
setStatus(ErrorConverting);
return;
}
...
}
I bet that 'IsFileReadable(file_to_load_)' can't handle 'C:/foo/bar.jpg'
Anyway, we go on from there to actually loading the file. Can Qt cope with
such abuse? I'd be musch happier if we generated a 'reasonable' file name in
the first place.
void QLImage::load(string const & filename)
{
if (!pixmap_.load(toqstr(filename))) {
lyxerr[Debug::GRAPHICS]
<< "Unable to open image" << endl;
return;
}
> I had a similar problem with the CVS lyx and had to apply the following
> patch:
Yes, but this works around the problem rather than addresses the primary
cause.
> I may be right, or I may be crazy.
> But it just might be a lunatic you're looking for...
In this case I want someone sane, but thanks for the offer ;-)
Regards,
Angus