Understanding Jquery-Cropper units












0















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










share|improve this question























  • I think they're pixels like the values in the table on the right. Some are decimal because they're calculated because of the fixed 16:9 ratio. Click the [Free] ratio button, change one of the values in the line, like "width:" from 552 to 100, and click [Set Crop Box Data]. The crop box will change to the new width.

    – ourmandave
    Nov 28 '18 at 19:50











  • I think they are not pixels, because the relation is different. At the right, X is greater than Y, but at the bottom is the opposite.

    – morgar
    Nov 28 '18 at 22:28











  • BTW, I found that [Get Data] returns the values in pixels like the fields at the right. So, I'm using those values while I decipher what [Get Crop Box Data] returns.

    – morgar
    Nov 28 '18 at 22:30
















0















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










share|improve this question























  • I think they're pixels like the values in the table on the right. Some are decimal because they're calculated because of the fixed 16:9 ratio. Click the [Free] ratio button, change one of the values in the line, like "width:" from 552 to 100, and click [Set Crop Box Data]. The crop box will change to the new width.

    – ourmandave
    Nov 28 '18 at 19:50











  • I think they are not pixels, because the relation is different. At the right, X is greater than Y, but at the bottom is the opposite.

    – morgar
    Nov 28 '18 at 22:28











  • BTW, I found that [Get Data] returns the values in pixels like the fields at the right. So, I'm using those values while I decipher what [Get Crop Box Data] returns.

    – morgar
    Nov 28 '18 at 22:30














0












0








0








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










share|improve this question














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







javascript jquery cropper






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 28 '18 at 18:56









morgarmorgar

2,1671216




2,1671216













  • I think they're pixels like the values in the table on the right. Some are decimal because they're calculated because of the fixed 16:9 ratio. Click the [Free] ratio button, change one of the values in the line, like "width:" from 552 to 100, and click [Set Crop Box Data]. The crop box will change to the new width.

    – ourmandave
    Nov 28 '18 at 19:50











  • I think they are not pixels, because the relation is different. At the right, X is greater than Y, but at the bottom is the opposite.

    – morgar
    Nov 28 '18 at 22:28











  • BTW, I found that [Get Data] returns the values in pixels like the fields at the right. So, I'm using those values while I decipher what [Get Crop Box Data] returns.

    – morgar
    Nov 28 '18 at 22:30



















  • I think they're pixels like the values in the table on the right. Some are decimal because they're calculated because of the fixed 16:9 ratio. Click the [Free] ratio button, change one of the values in the line, like "width:" from 552 to 100, and click [Set Crop Box Data]. The crop box will change to the new width.

    – ourmandave
    Nov 28 '18 at 19:50











  • I think they are not pixels, because the relation is different. At the right, X is greater than Y, but at the bottom is the opposite.

    – morgar
    Nov 28 '18 at 22:28











  • BTW, I found that [Get Data] returns the values in pixels like the fields at the right. So, I'm using those values while I decipher what [Get Crop Box Data] returns.

    – morgar
    Nov 28 '18 at 22:30

















I think they're pixels like the values in the table on the right. Some are decimal because they're calculated because of the fixed 16:9 ratio. Click the [Free] ratio button, change one of the values in the line, like "width:" from 552 to 100, and click [Set Crop Box Data]. The crop box will change to the new width.

– ourmandave
Nov 28 '18 at 19:50





I think they're pixels like the values in the table on the right. Some are decimal because they're calculated because of the fixed 16:9 ratio. Click the [Free] ratio button, change one of the values in the line, like "width:" from 552 to 100, and click [Set Crop Box Data]. The crop box will change to the new width.

– ourmandave
Nov 28 '18 at 19:50













I think they are not pixels, because the relation is different. At the right, X is greater than Y, but at the bottom is the opposite.

– morgar
Nov 28 '18 at 22:28





I think they are not pixels, because the relation is different. At the right, X is greater than Y, but at the bottom is the opposite.

– morgar
Nov 28 '18 at 22:28













BTW, I found that [Get Data] returns the values in pixels like the fields at the right. So, I'm using those values while I decipher what [Get Crop Box Data] returns.

– morgar
Nov 28 '18 at 22:30





BTW, I found that [Get Data] returns the values in pixels like the fields at the right. So, I'm using those values while I decipher what [Get Crop Box Data] returns.

– morgar
Nov 28 '18 at 22:30












1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer



















  • 1





    I noticed when you click [Zoom to 100%] that the [Get Data] width and height match the crop box width and height. So crop box data must be multiplied by the zoom %.

    – ourmandave
    Nov 29 '18 at 19:49












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53526283%2funderstanding-jquery-cropper-units%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














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.






share|improve this answer



















  • 1





    I noticed when you click [Zoom to 100%] that the [Get Data] width and height match the crop box width and height. So crop box data must be multiplied by the zoom %.

    – ourmandave
    Nov 29 '18 at 19:49
















0














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.






share|improve this answer



















  • 1





    I noticed when you click [Zoom to 100%] that the [Get Data] width and height match the crop box width and height. So crop box data must be multiplied by the zoom %.

    – ourmandave
    Nov 29 '18 at 19:49














0












0








0







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.






share|improve this 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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 29 '18 at 1:53









morgarmorgar

2,1671216




2,1671216








  • 1





    I noticed when you click [Zoom to 100%] that the [Get Data] width and height match the crop box width and height. So crop box data must be multiplied by the zoom %.

    – ourmandave
    Nov 29 '18 at 19:49














  • 1





    I noticed when you click [Zoom to 100%] that the [Get Data] width and height match the crop box width and height. So crop box data must be multiplied by the zoom %.

    – ourmandave
    Nov 29 '18 at 19:49








1




1





I noticed when you click [Zoom to 100%] that the [Get Data] width and height match the crop box width and height. So crop box data must be multiplied by the zoom %.

– ourmandave
Nov 29 '18 at 19:49





I noticed when you click [Zoom to 100%] that the [Get Data] width and height match the crop box width and height. So crop box data must be multiplied by the zoom %.

– ourmandave
Nov 29 '18 at 19:49




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53526283%2funderstanding-jquery-cropper-units%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks