You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
Current behavior
cropper.getData() support rounded:Boolean as parameter, but in our CMS we got this edge case:
AS you can see, the bottom border got increased by 1px
// before
y + height = 434.0000000000001
// after
y + height = 435
This 1px exceeds the image, and cause problems because we handle image cropping in server, with only coordinates got from js.
Expected behavior
The problem is that getData rounds x, y, width, height together.
Rather than rounding off width and height, maybe bottom, right is a more appropriate approach.
Minimal reproduction of the problem with instructions
Sorry it is very edge case, but here is very simple mental reproduction code
{
height: 100.5
width: 100.5
x: 100.5
y: 100.5}
if we round, it will result in
{
height: 101
width: 101
x: 101
y: 101}
What is the motivation / use case for changing the behavior?
bugfix.
Environment
Cropper.js version: 1.3.5
Browser:
- [x] Chrome (desktop) version 65.0.3325.181
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
Others:
The text was updated successfully, but these errors were encountered:
Unfortunatelly, when using with responsive image, and a cropper widget scaled down a bit, it miscalculates data when rounding is enabled. In example, crop height is 301.4000, but it gives 302 rounded. Such exported crop data is useless, as Cropper can't process it. When I try to set data on cropper init, it is reset to default, as Cropper knows, that 302 is oversized.
My init params are:
viewMode 1
movable false
zoomable false
rotatable false
scalable false
autoCropArea 1
restore false
ratio 9/16
Original image size 800x536
Resized responsive image 715x479
I'm submitting a...
Current behavior
cropper.getData() support
rounded:Boolean
as parameter, but in our CMS we got this edge case:AS you can see, the bottom border got increased by 1px
This 1px exceeds the image, and cause problems because we handle image cropping in server, with only coordinates got from js.
Expected behavior
The problem is that
getData
roundsx
,y
,width
,height
together.Rather than rounding off
width
andheight
, maybebottom
,right
is a more appropriate approach.Minimal reproduction of the problem with instructions
Sorry it is very edge case, but here is very simple mental reproduction code
if we round, it will result in
What is the motivation / use case for changing the behavior?
bugfix.
Environment
The text was updated successfully, but these errors were encountered: