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.
This commit is contained in:
Enrico Forestieri 2018-07-04 19:52:13 +02:00
parent 2c9e019a62
commit db9c8c6d02

View File

@ -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";