Beispiel #1
0
        public bool Identify(System.IO.Stream stream)
        {
            using (var reader = new Toolbox.Library.IO.FileReader(stream, true))
            {
                if (reader.BaseStream.Length < 30)
                {
                    return(false);
                }

                reader.Position = reader.BaseStream.Length - 18;
                bool IsValidMagic = reader.ReadString(10) == MagicFileConstant;
                bool IsTga        = IsValidMagic || Utils.GetExtension(FileName) == ".tga";
                if (IsTga)
                {
                    TargaImage tga = new TargaImage();
                    IsTga           = tga.IsSupportedTGA(stream);
                    stream.Position = 0;
                }
                return(IsTga);
            }
        }