]> git.lyx.org Git - lyx.git/blobdiff - src/Format.cpp
Amend 3093789e for cmake build
[lyx.git] / src / Format.cpp
index d639dbfd9fca1b9efe75ef91ac45a06fd5222284..62c09d0fa4cb2245fb428d9e31c67701a9a17329 100644 (file)
@@ -94,9 +94,9 @@ string const Format::extensions() const
 }
 
 
-bool Format::hasExtension(string const & e) const
+bool Format::hasExtension(string const & ext) const
 {
-       return (find(extension_list_.begin(), extension_list_.end(), e)
+       return (find(extension_list_.begin(), extension_list_.end(), ext)
                != extension_list_.end());
 }
 
@@ -255,8 +255,12 @@ string guessFormatFromContents(FileName const & fn)
                        } else if (stamp == "\377\330") {
                                format =  "jpg";
 
+                       } else if (prefixIs(str, "\x89PNG")) {
+                               format =  "png";
+
                        } else if (stamp == "\001\332") {
                                format =  "sgi";
+
                        } else if (prefixIs(str, binEPSStamp)) {
                                format =  "eps";
 
@@ -319,9 +323,6 @@ string guessFormatFromContents(FileName const & fn)
                else if (contains(str, " EMF"))
                        format = "emf";
 
-               else if (contains(str, "PNG"))
-                       format = "png";
-
                else if (contains(str, "%!PS-Adobe")) {
                        // eps or ps
                        ifs >> str;