CrackerakiUA/ngImgCropFullExtended

Rotate Image inside Crop Container.

Closed this issue · 6 comments

Does anyone know how you could go about rotating the canvas once an image is loaded? Often times pesky users will upload portrait images that we would like to rotate in the control before cropping, and it would be great if we could let them both rotate and crop in the same place.

That's an interesting question.
Generally you can rotate image inside an canvas, but to make it as option in cropper, hmm. Need to think how can that be done.

I already implemented Rotate in my application. I am happy to share it with you 😺

Here is a Codepen that shows how to do it:
http://codepen.io/HugeHugh/pen/NRgmWm

It is based on the SO post found here
http://stackoverflow.com/questions/17040360/javascript-function-to-rotate-a-base-64-image-by-x-degrees-and-return-new-base64

do you have implemented it inside our cropper? If so can you make PR? In code pen i see script outside plugin. If you have it the same way on your project i will add it.

hi, the implementation that i did for my app was in my controller. this worked fine for us so we can have the rotate buttons styled to match our app. i did not modify the plugin. it works pretty much the same as you see in the Codepen. sorry, i don't have a PR available for this right now. i guess if you want to make this part of the cropper, there needs to be some built-in rotation buttons in one corner of the image that would run the function that you see in the SO post i linked above. it could even support arbitrary rotation, if you wanted to write the UI for that.

yes, i will make it.

This repo is dead.
Please move to the other project:
https://github.com/CrackerakiUA/ui-cropper