GetByteArrayforImage() public static method

public static GetByteArrayforImage ( Stream input ) : byte[]
input Stream
return byte[]
Ejemplo n.º 1
0
        public override IEnumerable <IRow> Extract(IUnstructuredReader input, IUpdatableRow output)
        {
            byte[] img = ImageOps.GetByteArrayforImage(input.BaseStream);

            // load image only once into memory per row
            using (StreamImage inImage = new StreamImage(img))
            {
                output.SetColumnIfExists("image", img);
                output.SetColumnIfExists("equipment_make", inImage.getStreamImageProperty(ImageProperties.equipment_make));
                output.SetColumnIfExists("equipment_model", inImage.getStreamImageProperty(ImageProperties.equipment_model));
                output.SetColumnIfExists("description", inImage.getStreamImageProperty(ImageProperties.description));
                output.SetColumnIfExists("copyright", inImage.getStreamImageProperty(ImageProperties.copyright));
                output.SetColumnIfExists("thumbnail", inImage.scaleStreamImageTo(this._scaleWidth, this._scaleHeight));
            }
            yield return(output.AsReadOnly());
        }
Ejemplo n.º 2
0
 public override IEnumerable <IRow> Extract(IUnstructuredReader input, IUpdatableRow output)
 {
     byte[] imageArray = ImageOps.GetByteArrayforImage(input.BaseStream);
     output.Set <byte[]>(0, imageArray);
     yield return(output.AsReadOnly());
 }