cstefanache / angular2-img-cropper

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

not updating croppedWidth and croppedHeight #245

Open johnpaulmanoza opened 6 years ago

johnpaulmanoza commented 6 years ago

Hi, im trying to update the image croppedWidth and croppedHeight in cropped(bounds: Bounds) method but it is not working when exporting the result image. I can verify that the values printed is correct but those sizes are not working when exporting the result image. Please help. Thanks

cropped(bounds: Bounds) {
    this.cropper.settings.croppedWidth = bounds.right - bounds.left;
    this.cropper.settings.croppedHeight = bounds.bottom - bounds.top;
   console.log("changed sizes ", this.cropper.settings.croppedWidth, this.cropper.settings.croppedHeight);
}
torsten-simon commented 6 years ago

It looks like you want to archive can be done by activating the setting "preserveSize" this.cropper.settings.preserveSize=true;