angular2-img-cropper
angular2-img-cropper copied to clipboard
not updating croppedWidth and croppedHeight
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);
}
It looks like you want to archive can be done by activating the setting "preserveSize"
this.cropper.settings.preserveSize=true;