emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C file recoginzed as image file


From: Michaël Cadilhac
Subject: Re: C file recoginzed as image file
Date: Sun, 07 Jan 2007 10:28:01 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     http://www.w3.org/Graphics/GIF/spec-gif89a.txt tells me that the first
>     3 bytes contain the fixed value 'GIF', and the next 3 bytes contain
>     the version number:
>
> Can you find the list of actual valid version numbers?  I'd rather
> recognize those specific numberd, rather than any two-digit number
> whatsoever.

According to /usr/share/misc/file/magic, a GIF file is described as 

0       string          GIF8            GIF image data
>4      string          7a              \b, version 8%s,
>4      string          9a              \b, version 8%s,

So the regexp should be GIF8[79]a .

Actually, the two only versions of GIF are indeed 87a and 89a (named
after the year each format was created).

We probably should stick to the definitions of
/usr/share/misc/file/magic to create our magic variable.

-- 
 |      Michaël `Micha' Cadilhac     |  La culture c'est comme la confiture,  |
 |         Epita/LRDE Promo 2007     |      c'est meilleur avec du pain.      |
 |  http://michael.cadilhac.name     |           -- MOI59                     |
 `--JID: address@hidden'                                   -  --'

Attachment: pgpZk3wx8QlAo.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]