Beispiel #1
0
        internal static GifHeader ReadHeader(Stream stream)
        {
            var header = new GifHeader();

            header.Read(stream);
            return(header);
        }
Beispiel #2
0
        private void Read(Stream stream, bool metadataOnly)
        {
            this.Header = GifHeader.ReadHeader(stream);
            if (this.Header.LogicalScreenDescriptor.HasGlobalColorTable)
            {
                this.GlobalColorTable = GifHelpers.ReadColorTable(stream, this.Header.LogicalScreenDescriptor.GlobalColorTableSize);
            }
            this.ReadFrames(stream, metadataOnly);
            GifApplicationExtension ext = this.Extensions.OfType <GifApplicationExtension>().FirstOrDefault <GifApplicationExtension>(new Func <GifApplicationExtension, bool>(GifHelpers.IsNetscapeExtension));

            if (ext != null)
            {
                this.RepeatCount = GifHelpers.GetRepeatCount(ext);
            }
            else
            {
                this.RepeatCount = 1;
            }
        }
Beispiel #3
0
        private void Read(Stream stream, bool metadataOnly)
        {
            Header = GifHeader.ReadHeader(stream);

            if (Header.LogicalScreenDescriptor.HasGlobalColorTable)
            {
                GlobalColorTable = GifHelpers.ReadColorTable(stream, Header.LogicalScreenDescriptor.GlobalColorTableSize);
            }
            ReadFrames(stream, metadataOnly);

            var netscapeExtension =
                Extensions
                .OfType <GifApplicationExtension>()
                .FirstOrDefault(GifHelpers.IsNetscapeExtension);

            if (netscapeExtension != null)
            {
                RepeatCount = GifHelpers.GetRepeatCount(netscapeExtension);
            }
            else
            {
                RepeatCount = 1;
            }
        }
Beispiel #4
0
 internal static GifHeader ReadHeader(Stream stream)
 {
     var header = new GifHeader();
     header.Read(stream);
     return header;
 }