-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get the current zoom level #218
Comments
@Emaxoso, hello! First of all, why do you need to get the current zoom? To get the selected area you need coordinates only, they represent that area. const { coordinates } = this.$refs.cropper.getResult(); If you really need to get the current zoom, you should know that there is not concept of absolute zoom. There is the |
I use the zoom to resize the image. First I do the cropping with the coordinates then I use the zoom to enlarge the image. I was able to track the zoom by extending the Cropper component. export default defineComponent({
extends: Cropper,
emits: ['scale'],
watch: {
src() {
this.scale = 1.0;
},
scale() {
this.$emit("scale", Math.round(this.scale * 1000) / 1000);
}
},
data: () => ({
scale: 1.0
}),
methods: {
onManipulateImage(event, params = {}) {
if (event && event.scale) {
this.scale = Math.max(1, this.scale + 1 - event.scale.factor);
}
Cropper.methods.onManipulateImage.call(this, event, params);
},
},
}); |
@Emaxoso, I still don't get why? Should the following cases give the different result size? It's pretty strange, because the cropped part is the same in both cases. |
I also want to get current zoom level. |
Oh, yes! |
I changed library (needed for job then) |
I don't know if this is a bug or a missing feature.
I am trying to get the current zoom of the cropper, since for security reasons I need to crop on the server side, I was trying to find the image scale size.
I'm using the next branch
The text was updated successfully, but these errors were encountered: