The graphics converter for preview images creates a python conversion
script that tries to move the source file to the destination file if it
is already in the desired format. This is wrong, since the conversion
script is called with the original image file, so we would need to copy
it in that case.
Fortunately there is another test for equal formats in
CacheItem::Impl::convertToDisplayFormat, so this part of the conversion
script is never executed.
The attached patch (which is going in now) removes the wrong part and
replaces it with an assert.
Georg
Log:
* src/graphics/GraphicsConverter.C
(build_script): replace unused code for equal formats by an assert
Index: src/graphics/GraphicsConverter.C
===================================================================
--- src/graphics/GraphicsConverter.C (Revision 14393)
+++ src/graphics/GraphicsConverter.C (Arbeitskopie)
@@ -326,6 +326,7 @@ bool build_script(string const & from_fi
string const & to_format,
ostream & script)
{
+ BOOST_ASSERT(from_format != to_format);
lyxerr[Debug::GRAPHICS] << "build_script ... ";
typedef Converters::EdgePath EdgePath;
@@ -346,12 +347,6 @@ bool build_script(string const & from_fi
string const to_file = to_file_base + '.'
+ formats.extension(to_format);
- if (from_format == to_format) {
- script << move_file(quoteName(from_file), quoteName(to_file));
- lyxerr[Debug::GRAPHICS] << "ready (from == to)" << endl;
- return true;
- }
-
EdgePath edgepath = converters.getPath(from_format, to_format);
if (edgepath.empty()) {