commit db9c8c6d0229eccdcc28d55eead018d9e40347a4
Author: Enrico Forestieri <[email protected]>
Date: Wed Jul 4 19:52:13 2018 +0200
Autodetect the EMF format
Otherwise it will be recognized only by the file extension, because
libmagic returns "application/octet-stream" as mime type. Moreover,
if the emf encapsulates a binary image format, it can be confused
with this other format and its preview on screen fails.
---
src/Format.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/Format.cpp b/src/Format.cpp
index a4882f6..ab09d4a 100644
--- a/src/Format.cpp
+++ b/src/Format.cpp
@@ -337,6 +337,9 @@ string guessFormatFromContents(FileName const & fn)
// autodetect pdf format for graphics inclusion
format = "pdf6";
+ else if (contains(str, " EMF"))
+ format = "emf";
+
else if (contains(str, "PNG"))
format = "png";