From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=DATE_IN_PAST_24_48, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 22546 invoked from network); 4 Apr 2021 22:39:32 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 4 Apr 2021 22:39:32 -0000 Received: from mail-40130.protonmail.ch ([185.70.40.130]) by 1ess; Sat Apr 3 13:24:34 -0400 2021 Date: Sat, 03 Apr 2021 17:24:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1617470668; bh=jddJk44vS2eA5/vsGu4lEP6+y9NOXOCtGGomdDExxYs=; h=Date:To:From:Reply-To:Subject:From; b=lbjgpSfxWtVJNNnR7/Lw6sOluIyGTQlShtKOx03ecc+X6qefvivOXOHuDqCUloNsf mgk+3sjcr2hvV3JZICepJjX2JCd2ZLdzxnuUWaOfpWXc++XiodleTZGQOG6jWZjXew iNalakGCqXzDTUvxqb538wS7+yexF4t7R73+MmuQ= To: "9front@9front.org" <9front@9front.org> From: kemal Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: virtualized enhancement configuration interface Subject: [9front] file: detect webp files Reply-To: 9front@9front.org Precedence: bulk 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=09Sat Mar 13 14:57:53 2021 +0100 +++ b/sys/src/cmd/file.c=09Sat Apr 03 20:17:09 2021 +0300 @@ -962,6 +962,8 @@ =09=09=09print("%s\n", mime? "audio/wave": "wave audio"); =09=09else if (strncmp((char*)buf+8, "AVI ", 4) =3D=3D 0) =09=09=09print("%s\n", mime? "video/avi": "avi video"); +=09=09else if (strncmp((char*)buf+8, "WEBP", 4) =3D=3D 0) +=09=09=09print("%s\n", mime? "image/webp": "webp image"); =09=09else =09=09=09print("%s\n", mime? OCTET : "riff file"); =09=09return 1;