Skip to content

problem with .jpeg/tiff files not loading because of stream.Position is incorrect after read of file header #16

Description

@OneB1t

stream.Position = 0;

solution:

            var position = stream.Position;
            stream.Position = 0;
            var magic = new byte[Signature.MaxLength];
            stream.Read(magic, 0, magic.Length);
            if (Signature.IsGifSignature(magic))
            {
                stream.Position = 0;
                var gif = new GifFile(stream);
                renderer = new GifRenderer(gif, factory);

                return true;
            }
            else
            {
                stream.Position = position;
            }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions