9front - general discussion about 9front
 help / color / mirror / Atom feed
From: kemal <kemali13@protonmail.com>
To: "9front@9front.org" <9front@9front.org>
Subject: [9front] file: detect webp files
Date: Sat, 03 Apr 2021 17:24:24 +0000	[thread overview]
Message-ID: <kMblIlbZSJ6-0aXXR7dWlNACXHuA3O8RCnKr2xi5tF20BEgTp82w00LnUTT94YclC9qppIhLiT9mniuBMpE1qg0GBw-dQNIHJfTPeojY3f8=@protonmail.com> (raw)

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;

             reply	other threads:[~2021-04-04 22:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-03 17:24 kemal [this message]
2021-04-03 17:32 ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='kMblIlbZSJ6-0aXXR7dWlNACXHuA3O8RCnKr2xi5tF20BEgTp82w00LnUTT94YclC9qppIhLiT9mniuBMpE1qg0GBw-dQNIHJfTPeojY3f8=@protonmail.com' \
    --to=kemali13@protonmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).