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: Chris Moore
Subject: Re: C file recoginzed as image file
Date: Sat, 06 Jan 2007 13:42:14 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     Similarly, any text file which starts with the 4 characters "GIF8" is
>     treated as if it was an image.
>
> Is there anything else we could check for
> to distinguish real GIF files from other files?
> Would someone please check the spec?

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:

            Version Numbers as of 10 July 1990 :       "87a" - May 1987
                                                       "89a" - July 1989

            Version numbers are ordered numerically increasing on the first two
            digits starting with 87 (87,88,...,99,00,...,85,86) and
            alphabetically increasing on the third character (a,...,z).

Immediately after this 6 byte header comes the logical screen
descriptor, which doesn't contain anything we can use to recognise a
valid image.

So a better image-type-header-regexps entry would be:

    ("\\`GIF[0-9][0-9][a-z]" . gif)




reply via email to

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