gingerBill 3 years ago
parent
commit
f7b18cd86e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/image/which.odin

+ 6 - 0
core/image/which.odin

@@ -6,6 +6,7 @@ Which_File_Type :: enum {
 	Unknown,
 
 	BMP,
+	DjVu, // AT&T DjVu file format
 	EXR,
 	FLIF,
 	GIF,
@@ -88,6 +89,11 @@ which_bytes :: proc(data: []byte) -> Which_File_Type {
 	switch {
 	case s[:2] == "BM":
 		return .BMP
+	case s[:8] == "AT&TFORM":
+		switch s[12:16] {
+		case "DJVU", "DJVM":
+			return .DjVu
+		}
 	case s[:4] == "\x76\x2f\x31\x01":
 		return .EXR
 	case s[:6] == "GIF87a", s[:6] == "GIF89a":