Closed koki000 closed 4 years ago
I've managed to do it by checking the "naturalWidth" on resize and after upload and updating the "quality" based on the width of the container.
Sample for resize event:
if(this.myCroppa.naturalWidth > 0){
if(picWrapper.getBoundingClientRect().width < this.myCroppa.naturalWidth)
this.picQuality = this.myCroppa.naturalWidth / picWrapper.getBoundingClientRect().width;
}
Is there an option to keep the original size (for example original width) of the picture and just crop the aspect ratio no matter the size of the container? If I upload a picture with dimensions 1200x700px I would like to crop the image to fit the aspect ratio of 16:9 and get 1200x675px. Is this possible?