diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 9632c5c166..bba54dfa72 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,10 @@ +2002-12-18 Jean-Marc Lasgouttes + + * insetgraphics.C (prepareFile): do not remove the extension of + the file name if it is not the default extension for the given + format (that is, in latex output, remove extension from foo.eps, + but not from foo.epsi) + 2002-12-17 Alfredo Braunstein * insettext.C (lfunMouseRelease): hackish solution to the "double diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 79bb4f0a93..5fb9e60572 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -592,11 +592,16 @@ string const InsetGraphics::prepareFile(Buffer const * buf) const lyxerr[Debug::GRAPHICS] << "\t we have: from " << from << " to " << to << '\n'; - if (from == to && !lyxrc.use_tempdir) + if (from == to && !lyxrc.use_tempdir) { // No conversion is needed. LaTeX can handle the // graphic file as is. // This is true even if the orig_file is compressed. - return RemoveExtension(orig_file_with_path); + if (formats.getFormat(to)->extension() == GetExtension(orig_file)) { + return RemoveExtension(orig_file_with_path); + } else { + return orig_file_with_path; + } + } // We're going to be running the exported buffer through the LaTeX // compiler, so must ensure that LaTeX can cope with the graphics @@ -639,12 +644,16 @@ string const InsetGraphics::prepareFile(Buffer const * buf) const } } - if (from == to) + if (from == to) { // No conversion is needed. LaTeX can handle the // graphic file as is. - return RemoveExtension(temp_file); + if (formats.getFormat(to)->extension() == GetExtension(orig_file)) + return RemoveExtension(temp_file); + else + return temp_file; + } } - + string const outfile_base = RemoveExtension(temp_file); lyxerr[Debug::GRAPHICS] << "\tThe original file is " << orig_file << "\n"