Skip to content
Advertisement

Understanding Jquery-Cropper units

I’m making a project using jquery-cropper (https://fengyuanchen.github.io/jquery-cropper/).

I need to get the coordinates of the crop rectangle. The method getCropBoxData() return those coordinates, but I can’t get what units it’s using, and the documentation doesn’t mention them.

Check the picture of the demo page I’m attaching. The fields at the right show the current position of the crop in pixels, but if you press [Get Crop Box Data], you get totally different values at the bottom. Any ideas?

enter image description here

Advertisement

Answer

I will answer my question. For this specific issue, I found that getData method returns the crop coordinates in pixels, the same values that appear at the right in the demo page. This should be useful for anybody that need to get the crop info. About getCropBoxData, still not sure what units are those.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement