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()); }
public override IEnumerable <IRow> Extract(IUnstructuredReader input, IUpdatableRow output) { byte[] imageArray = ImageOps.GetByteArrayforImage(input.BaseStream); output.Set <byte[]>(0, imageArray); yield return(output.AsReadOnly()); }