with this patch the epsi-files are detected and
converted correct.

Does somebody knows why

convert file.epsi file....

fails??

Herbert



-- 
http://www.lyx.org/help/
Index: lib/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.219
diff -u -r1.219 ChangeLog
--- lib/ChangeLog       5 Jun 2002 15:07:44 -0000       1.219
+++ lib/ChangeLog       6 Jun 2002 06:21:49 -0000
@@ -1,3 +1,8 @@
+2002-06-06  Herbert Voss  <[EMAIL PROTECTED]>
+
+       * configure.m4: convert epsi files correct, until we really
+       know why "convert epsi:..." fails
+
 2002-06-05  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
        * external_templates: change the requirements of the xfig and
Index: lib/configure.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v
retrieving revision 1.40
diff -u -r1.40 configure.m4
--- lib/configure.m4    29 May 2002 22:07:58 -0000      1.40
+++ lib/configure.m4    6 Jun 2002 06:21:49 -0000
@@ -378,10 +378,12 @@
   convert)
     gif_to_png="convert GIF:\$\$i PNG:\$\$o"
     eps_to_png="convert EPS:\$\$i PNG:\$\$o"
+    epsi_to_png="eps2eps -sOutputFile=- \$\$i dummy.eps | convert - PNG:\$\$o"
     jpg_to_png="convert JPG:\$\$i PNG:\$\$o";;
   pnmtopng)
     gif_to_png="giftopnm \$\$i | pnmtopng >\$\$o"
     eps_to_png="pstopnm \$\$i| pnmtopng >\$\$o"
+    epsi_to_png="pstopnm \$\$i| pnmtopng >\$\$o"
     jpg_to_png="jpegtopnm \$\$i | pnmtopng >\$\$o";;
 esac
 
@@ -389,6 +391,7 @@
 if test "$TOXPM" = "convert"; then
   gif_to_xpm="convert GIF:\$\$i XPM:\$\$o"
   eps_to_xpm="convert EPS:\$\$i XPM:\$\$o"
+  epsi_to_xpm="eps2eps -sOutputFile=- \$\$i dummy.eps | convert - XPM:\$\$o"
   jpg_to_xpm="convert JPG:\$\$i XPM:\$\$o"
   png_to_xpm="convert PNG:\$\$i XPM:\$\$o"
   ps_to_xpm="convert PS:\$\$i XPM:\$\$o"
@@ -558,12 +561,12 @@
 
 \\converter gif  png "$gif_to_png" ""
 \\converter eps  png "$eps_to_png" ""
-\\converter epsi png "$eps_to_png" ""
+\\converter epsi png "$epsi_to_png" ""
 \\converter jpg  png "$jpg_to_png" ""
 
 \\converter gif  xpm "$gif_to_xpm" ""
 \\converter eps  xpm "$eps_to_xpm" ""
-\\converter epsi xpm "$eps_to_xpm" ""
+\\converter epsi xpm "$epsi_to_xpm" ""
 \\converter jpg  xpm "$jpg_to_xpm" ""
 \\converter png  xpm "$png_to_xpm" ""
 \\converter ps  xpm "$ps_to_xpm" ""
Index: src/support/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.112
diff -u -r1.112 ChangeLog
--- src/support/ChangeLog       5 Jun 2002 15:23:19 -0000       1.112
+++ src/support/ChangeLog       6 Jun 2002 06:21:50 -0000
@@ -1,3 +1,7 @@
+2002-06-06  Herbert Voss  <[EMAIL PROTECTED]>
+
+       * filetools.C (getExtFromContents): detect epsi files correct
+
 2002-06-05  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
        * lxtl.h: remove unused file
Index: src/support/filetools.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/filetools.C,v
retrieving revision 1.122
diff -u -r1.122 filetools.C
--- src/support/filetools.C     25 May 2002 00:19:56 -0000      1.122
+++ src/support/filetools.C     6 Jun 2002 06:21:51 -0000
@@ -984,6 +984,8 @@
 // AGR Grace...
 // BMP BM...
 // EPS %!PS-Adobe-3.0 EPSF...
+// EPSI like EPS and with
+//      %%BeginPreview...
 // FITS ...BITPIX...
 // GIF GIF...
 // JPG JFIF
@@ -1148,9 +1150,25 @@
        }
 
        if (!format.empty()) {
-           lyxerr[Debug::GRAPHICS]
-               << "Recognised Fileformat: " << format << endl;
-           return format;
+               // if we have eps than epsi is also possible
+               // we have to check for a preview
+               if (format == "eps") {
+                       lyxerr[Debug::GRAPHICS]
+                               << "\teps detected -> test for an epsi ..."
+                               << endl;
+                       while (count++ < max_count) {
+                               if (ifs.eof())
+                                       break;
+                               getline(ifs, str);
+                               if (contains(str, "BeginPreview")) {
+                                       format = "epsi";
+                                       count = max_count;
+                               }
+                       }
+               }
+               lyxerr[Debug::GRAPHICS]
+                       << "Recognised Fileformat: " << format << endl;
+               return format;
        }
 
        string const ext(GetExtension(filename));

Reply via email to