From d41c867696019e4408431230d8fae0dcf7603dc4 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 3 Apr 2021 19:32:47 +0200 Subject: file: detect webp files (thanks kemal) this patch adds a small check to the "iff" function, so this way file can detect webp files. tested with a webp file i found randomly. --- sys/src/cmd/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/src/cmd/file.c b/sys/src/cmd/file.c index 2e53dbee8..ba34eb009 100644 --- a/sys/src/cmd/file.c +++ b/sys/src/cmd/file.c @@ -962,6 +962,8 @@ iff(void) print("%s\n", mime? "audio/wave": "wave audio"); else if (strncmp((char*)buf+8, "AVI ", 4) == 0) print("%s\n", mime? "video/avi": "avi video"); + else if (strncmp((char*)buf+8, "WEBP", 4) == 0) + print("%s\n", mime? "image/webp": "webp image"); else print("%s\n", mime? OCTET : "riff file"); return 1; -- cgit v1.2.3