Better PNG detection in guessFormatFromContents

This commit is contained in:
Yuriy Skalko 2020-11-25 02:12:04 +02:00
parent 9521834e3a
commit 43477730a4

View File

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