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

Rotate image improvements #537

Closed
filipiandrader opened this issue Dec 14, 2022 · 7 comments
Closed

Rotate image improvements #537

filipiandrader opened this issue Dec 14, 2022 · 7 comments

Comments

@filipiandrader
Copy link

I was developing a feature where I need to rotate the image by a specific angle, but I realized that the rotateImage function wasn't working correctly, when I was aligning it to any side and trying to go back one or two degrees it didn't work correctly correct. I decided to see how it was being done and made the correction, I recorded two videos, the first is showing how it is currently and the second has already been corrected and working correctly.

before adjusting the method:

Screen_Recording_20221214_180226_Android.Image.Cropper.mp4

after adjusting the method:

Screen_Recording_20221214_180749_One.UI.Home.mp4

I also noticed that it would be more interesting to change the parameter type from integer to float, in case someone wants to develop a feature using a range of values and these values have values of type float.

if you approve such changes, I can open a PR and it will have all the changes that were made

@vanniktech
Copy link
Contributor

Yes, PR with any improvements are welcome! I don't use this particular feature.

@filipiandrader
Copy link
Author

filipiandrader commented Dec 15, 2022

@vanniktech, but I have a problem, when I pass a negative angle and the method calculates the positive value, the crop overlay does not follow the photo correctly, do you know how I can adjust this for this fix?

untitled.mp4

@vanniktech
Copy link
Contributor

Unfortunately no. I'm also new to this code base

@filipiandrader
Copy link
Author

filipiandrader commented Dec 15, 2022

@Canato can you help me with this overlay bug?

when it rotates negatively, this happens:

untitled.1.mp4

but when it rotates to the positive degree, it works.

@Canato
Copy link
Member

Canato commented Dec 19, 2022

@filipiandrader I would love to be able to help. But the rotation has been my worst nightmare on this lib. #95

It is literally the one thing that I couldn't do from my to-do list in this lib 😭.

My lame suggestion (because you did much more them I was able) is to check for negative numbers and do the 360 math to make it positive.

Like -90 rotation equals to 270 but not sure if this will keep it smooth or not

@spporan
Copy link

spporan commented Jan 25, 2023

After opening the CropImageActivity, the system back press does not work. Seems to be an interrupted system back press.

@Canato
Copy link
Member

Canato commented Jan 25, 2023

After opening the CropImageActivity, the system back press does not work. Seems to be an interrupted system back press.

Sorry @spporan is this related to the rotation?

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

4 participants