Bo Peng wrote:
> Open the attached file, put http://www.lyx.org/~bpeng/geno.jpg to the
> same directory, clicking the only graphics inset, or view pdf
> will crash lyx under linux. Can anyone confirm? The problem seems to
> be with the graphics file, which can not be properly viewed, but this
> should not crash lyx.

I can reproduce it (but it's an assertion, no crash, so it shouldn't occur in 
the released version).

Your graphic file is detected as a gzipped jpeg image, and since it has none 
of the extensions "gz", "z" or "Z" (where this extension would just be 
removed for the uncompressed version), a file name with the "unzipped_" 
prefix is constructed in filetools::unzippedFileName for uncompressing 
purposes.

Now the problem is that this "unzipped_" prefix is prepended to the path 
instead of to the file name, which triggers the absolutePath assertion.

The attached patch (against branch) fixes the problem for me and strikes me 
sensible anyway.

OK?

Jürgen
Index: src/support/filetools.cpp
===================================================================
--- src/support/filetools.cpp	(Revision 24143)
+++ src/support/filetools.cpp	(Arbeitskopie)
@@ -1008,7 +1008,7 @@
 	string const ext = getExtension(zipped_file);
 	if (ext == "gz" || ext == "z" || ext == "Z")
 		return changeExtension(zipped_file, string());
-	return "unzipped_" + zipped_file;
+	return onlyPath(zipped_file) + "unzipped_" + onlyFilename(zipped_file);
 }
 
 

Reply via email to