Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation #11

Closed
sharifme04 opened this issue Jun 25, 2021 · 5 comments
Closed

Rotation #11

sharifme04 opened this issue Jun 25, 2021 · 5 comments

Comments

@sharifme04
Copy link

Hi,Is it possible to do rotation?

@giacomocerquone
Copy link
Owner

@sharifme04 hi, thanks for writing!
What kind of rotation are you talking about?
Could you specify your use case a bit? That might help finding a solution

@sharifme04
Copy link
Author

sharifme04 commented Jun 25, 2021

@giacomocerquone Hi thank you for your quick answer. I mean after taking the image when the border detect is done, then if we want we can rotate clock wise or anti clock wise based on our requirement . is it clear now ?

@giacomocerquone
Copy link
Owner

I hope that is not your credit card, don't post this kind of information publicly (luckily the cvv isn't shown here).

Anyway, rotation can easily be achieved once you get the scanned picture and redraw a canvas.
If you're asking if I'd like to provide a method directly inside the library as the other methods, no... this library should focus only on scanning.

If you don't want to reimplement the wheel, you can get the picture that my library gives you and then use something like: https://github.com/DominicTobias/react-image-crop#readme

@sharifme04
Copy link
Author

sharifme04 commented Jun 25, 2021

HI thank you, it's my old card which is invalid, don't worry.

About the rotation, my opinion was in this should be a rotation also. but if you do not prefer it is up to you. react-cropper, or react image crop both are nice library but unfortunately, both of those libraries do not detect the border. react-cropper has more options than react-image-crop.

@giacomocerquone
Copy link
Owner

giacomocerquone commented Jun 26, 2021

 @sharifme04 yes I know they don't detect the border. For this reason, you can use ref.current.done({ preview: false }) which will return the cropped image and then you give the cropped image to the tool you chose to use to rotate the image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants