* [9front] file: detect webp files
@ 2021-04-03 17:24 kemal
2021-04-03 17:32 ` cinap_lenrek
0 siblings, 1 reply; 2+ messages in thread
From: kemal @ 2021-04-03 17:24 UTC (permalink / raw)
To: 9front
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.
diff -r cc26fdf57bb2 sys/src/cmd/file.c
--- a/sys/src/cmd/file.c Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/src/cmd/file.c Sat Apr 03 20:17:09 2021 +0300
@@ -962,6 +962,8 @@
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [9front] file: detect webp files
2021-04-03 17:24 [9front] file: detect webp files kemal
@ 2021-04-03 17:32 ` cinap_lenrek
0 siblings, 0 replies; 2+ messages in thread
From: cinap_lenrek @ 2021-04-03 17:32 UTC (permalink / raw)
To: 9front
applied.
--
cinap
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-05 6:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-03 17:24 [9front] file: detect webp files kemal
2021-04-03 17:32 ` cinap_lenrek
9front - general discussion about 9front
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://inbox.vuxu.org/9front
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V1 9front 9front/ http://inbox.vuxu.org/9front \
9front@9front.org
public-inbox-index 9front
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://inbox.vuxu.org/vuxu.archive.9front
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git