Example #1
0
        public static ImageInfo?Info(Stream stream)
        {
            var decoder = new GifDecoder(stream);

            int comp;
            var r = decoder.stbi__gif_header(out comp, 1);

            stream.Rewind();
            if (r == 0)
            {
                return(null);
            }

            return(new ImageInfo
            {
                Width = decoder.w,
                Height = decoder.h,
                ColorComponents = (ColorComponents)comp,
                BitsPerChannel = 8
            });
        }
Example #2
0
        public static ImageResult Decode(Stream stream, ColorComponents?requiredComponents = null)
        {
            var decoder = new GifDecoder(stream);

            return(decoder.InternalDecode(requiredComponents));
        }