John Levon wrote:

> On Sun, Apr 28, 2002 at 12:31:07AM +0200, Herbert Voss wrote:
> 
> 
>>LyX itself needs the "real" filename, means with extension.
>>Remeber that 1.2.0 allows a lot of different graphic formats,
>>which are converted to eps or pdf.
>>
> 
> Can you mention this in UPGRADING then please ?


this is a real "bug" in 1.2.0pre4!

here is a patch, to get the same behaviour as in 1.1.6:


without extension:
- no view in LyX (because we do not know which file should be
   viewed in LyX if different extensions are present,
   f.ex: file.gif file.eps.
- pass file to latex when file exists with an extension
   like .(e)ps



Herbert

-- 
http://www.lyx.org/help/
Index: src/insets/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.406
diff -u -r1.406 ChangeLog
--- src/insets/ChangeLog        26 Apr 2002 15:38:15 -0000      1.406
+++ src/insets/ChangeLog        28 Apr 2002 07:01:30 -0000
@@ -1,3 +1,8 @@
+2002-04-28  Herbert Voss  <[EMAIL PROTECTED]>
+
+       * insetgraphics.C (latex): fix bug with missing file-extension.
+       LaTeX still allows a missing "eps" or "ps".
+
 2002-04-26  Angus Leeming  <[EMAIL PROTECTED]>
 
        * insetfloat.C (c-tor, wide): translate the name of the float.
Index: src/insets/insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.106
diff -u -r1.106 insetgraphics.C
--- src/insets/insetgraphics.C  24 Apr 2002 10:53:55 -0000      1.106
+++ src/insets/insetgraphics.C  28 Apr 2002 07:01:30 -0000
@@ -703,16 +703,26 @@
        // If there is no file specified or not existing,
        // just output a message about it in the latex output.
        lyxerr[Debug::GRAPHICS]
-               << "InsetGraphics::latex. Filename = "
+               << "insetgraphics::latex: Filename = "
                << params().filename << endl;
 
-       string const message =
-           (IsFileReadable(MakeAbsPath(params().filename, buf->filePath()))
-               && !params().filename.empty()) ?
-                   string() :
-                   string("bb = 0 0 200 100, draft, type=eps]");
+       // A missing (e)ps-extension is no problem for LaTeX, so
+       // we have to test three different cases
+       string const file_(MakeAbsPath(params().filename, buf->filePath()));
+       bool file_exist = 
+               !file_.empty() && 
+               ( IsFileReadable(file_) ||              // original
+                 IsFileReadable(file_ + ".eps") ||     // original.eps
+                 IsFileReadable(file_ + ".ps") );      // original.ps
+       string const message = file_exist ? 
+               string() :
+               string("bb = 0 0 200 100, draft, type=eps]");
+       // if !message.empty() than there was no existing file
+       // "filename(.(e)ps)" found. In this case LaTeX
+       // draws only a rectangle with the above bb and the
+       // not found filename in it.
        lyxerr[Debug::GRAPHICS]
-               << "InsetGraphics::latex. Message = " << message << endl;
+               << "InsetGraphics::latex. Message = \"" << message << '\"' << endl;
 
        // These variables collect all the latex code that should be before and
        // after the actual includegraphics command.

Reply via email to