scottcheng / cropit

A "customizable crop and zoom" jQuery plugin.
http://scottcheng.github.io/cropit/
MIT License
874 stars 307 forks source link

Using PHP library to crop the image #252

Open salahy2 opened 7 years ago

salahy2 commented 7 years ago

Hello, I am using this library http://image.intervention.io/api/crop to crop the image, it take x and y, I tried to use the offsets but they are wrong, can anyone help me ?

Thanks

FahriDevZ commented 6 years ago

To find offset you can use api onOffsetChange. To find the width and height you can user api onImageLoaded like this

onImageLoaded = function() {
    console.log(this.$preview.width());
    console.log(this.$preview.height());
};
hamzazafeer commented 6 years ago

@Fahri5567 your code provide height and width of original image, not the croped image height and widht?