ImageTools.IO.Gif.GifDecoder.IsSupportedFileFormat C# (CSharp) Method

IsSupportedFileFormat() public method

Indicates if the image decoder supports the specified file header.
/// is null (Nothing in Visual Basic).
public IsSupportedFileFormat ( byte header ) : bool
header byte The file header.
return bool
        public bool IsSupportedFileFormat(byte[] header)
        {
            bool isGif = false;

            if (header.Length >= 6)
            {
                isGif =
                    header[0] == 0x47 && // G
                    header[1] == 0x49 && // I
                    header[2] == 0x46 && // F
                    header[3] == 0x38 && // 8
                   (header[4] == 0x39 || header[4] == 0x37) && // 9 or 7
                    header[5] == 0x61;   // a
            }

            return isGif;
        }