The function getData() can get everything about the image besides its current zoom level.
Is it possible to get this?
Use getImageData method:
var image = $('img').cropper('getImageData');
image.zoomLevel = image.width / image.naturalWidth;
@fengyuanchen - I'm getting the zoom level (using your above method( and then using the same number to set the zoom using zoom(). Unfortunately this is not setting the zoom level as it originally was?
You should use relative ratio on the zoom method:
var image = $('img').cropper('getImageData');
$('img').cropper('zoom', (image.naturalWidth - image.width) / image.width);
Most helpful comment
You should use relative ratio on the
zoommethod: