JsImageCrop
JsImageCrop copied to clipboard
How crop ratio can be set for rectangular area ?
Docs claims this is possible, but I don't see such option.
Right now it crops to the size of your rectangle. You mean you want to specify the aspect ratio?
Can you provide more details?
Or fix the rectangle to a certain aspect ratio?
Yes, fix the rectangle to a certain aspect ratio.
It does not do that yet but I could make it do that. When do you need it by?
As usual, ASAP :)
:) Might be able to get this done by monday.
:+1:
Feel free to make a pr for this in the meantime. ;)
I did first step, but there are some issues with my code.
First of all when user sets aspect ratio for rectangular crop area, the starting crop area should be drawn with this aspect ratio.
Second, the min size area should be taken into account.
Last: the accuracy of the calculations. Let's say the ratio is 2. The bottom right corner is moved left by 11px. So the y coordinate should change 11/2 = 5.5. We can't move half pixel. Right now I round it, but of course this causes that we lose accuracy.
Try forcing the scale and only letting the crop area be dragged in one deception.
Use the min width as the lower of the two sides in the aspect ratio?
Sent from my iPhone
On Mar 21, 2015, at 4:45 AM, Olga Grabek [email protected] wrote:
I did first step, but there are some issues with my code.
First of all when user sets aspect ratio for rectangular crop area, the starting crop area should be drawn with this aspect ratio.
Second, the min size area should be taken into account.
Last: the accuracy of the calculations. Let's say the ratio is 2. The bottom right corner is moved left by 11px. So the y coordinate should change 11/2 = 5.5. We can't move half pixel. Right now I round it, but of course this causes that we lose accuracy.
— Reply to this email directly or view it on GitHub.
Any updates with this?
EDIT: I hacked together an aspect ratio lock for a quick turnaround on a project I'm working on, it's not the most elegant as it simply forces the aspect ratio whenever the rectangular crop area is drawn, but it certainly works if anyone's after a quick fix. Will work on something a little more sensible solution when I'm through this backlog.
Any update on the lock aspect ratio? Or set a defined crop width/height ?
Please guys update this issue, how to lock aspect ration ?
That option would be really awesome, i have two project where i could use it :)
Any new developments on this front? This is really a crucial feature. @LukeeeeBennett, would you mind sharing your hack? Either code or an explanation of how you did it would be fine.
Actually i build awesome fork, you can check https://github.com/CrackerakiUA/ngImgCropFullExtended