Exemple #1
0
        public override ImageData Read(IBinaryStream stream, ImageMetaData info)
        {
            var meta = (SpdMetaData)info;

            if (Compression.Jpeg == meta.Method)
            {
                return(ReadJpeg(stream.AsStream, meta));
            }

            using (var reader = new SpdReader(stream.AsStream, meta))
            {
                reader.Unpack();
                return(ImageData.Create(info, reader.Format, null, reader.Data));
            }
        }
Exemple #2
0
        public override ImageData Read(Stream stream, ImageMetaData info)
        {
            var meta = info as SpdMetaData;

            if (null == meta)
            {
                throw new ArgumentException("SpdFormat.Read should be supplied with SpdMetaData", "info");
            }
            if (Compression.Jpeg == meta.Method)
            {
                return(ReadJpeg(stream, meta));
            }

            using (var reader = new SpdReader(stream, meta))
            {
                reader.Unpack();
                return(ImageData.Create(info, reader.Format, null, reader.Data));
            }
        }