Example #1
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;
            }
        }
Example #2
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;
            }
        }