From cb99a555883561864ee985dde8b0f2bd50e724fe Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 22 May 2006 09:37:29 +0000 Subject: [PATCH] * src/insets/insetgraphics.C (InsetGraphics::prepareFile): Rename file in the temp dir if the extension does not match the format (bug 2235) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@13900 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insetgraphics.C | 15 +++++++++++++++ status.14x | 3 +++ 2 files changed, 18 insertions(+) diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 185911e2ee..f8bc1675e7 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -681,6 +681,21 @@ string const InsetGraphics::prepareFile(Buffer const & buf, << "\tthe orig file is: " << orig_file << endl; if (from == to) { + if (!runparams.nice && GetExtension(temp_file) != ext) { + // The LaTeX compiler will not be able to determine + // the file format from the extension, so we must + // change it. + string const new_file = ChangeExtension(temp_file, ext); + if (lyx::support::rename(temp_file, new_file)) { + temp_file = new_file; + output_file = ChangeExtension(output_file, ext); + source_file = ChangeExtension(output_file, ext); + } else + lyxerr[Debug::GRAPHICS] + << "Could not rename file `" + << temp_file << "' to `" << new_file + << "'." << endl; + } // The extension of temp_file might be != ext! runparams.exportdata->addExternalFile(tex_format, source_file, output_file); diff --git a/status.14x b/status.14x index 6edaca1948..fbb46b0aaa 100644 --- a/status.14x +++ b/status.14x @@ -64,6 +64,9 @@ What's new - Update templates and examples to latest file format. +- Make jpeg graphics with suffix in capital letters (.JPG) work with + pdflatex (bug 2235) + * Math editor: - Fix metrics of AMS array environments like bmatrix, vmatrix etc. (bug 2036)