cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

Encapsulate file reading #127

Open aberezkin opened 7 years ago

aberezkin commented 7 years ago

I think it could be useful to provide an interface not only for Image objects but for File objects too.

Just create public method setFile(file: File) that will read file using FileReader internally and call setImage(img: Image). This will reduce the amount of boilerplate code and make your library more usable.