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?
javascript jquery cropper
add a comment |
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?
javascript jquery cropper
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
add a comment |
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?
javascript jquery cropper
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?
javascript jquery cropper
javascript jquery cropper
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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