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

Question: Correct cropping params #319

Open
emartynov opened this issue Feb 3, 2021 · 6 comments
Open

Question: Correct cropping params #319

emartynov opened this issue Feb 3, 2021 · 6 comments

Comments

@emartynov
Copy link
Contributor

Hi people,

I'm implementing cropping. So I need the original image size.

As for now I use drawable.intrinsicWidth, drawable.intrinsicHeight and zoomedRect.

However, I saw in source code that image can be rotated and I'm not sure that zoomedRect returns correct data if not zoomed.

@emartynov
Copy link
Contributor Author

emartynov commented Feb 3, 2021

Oke, zoomedRect question is clear - it returns bogus if the image is not zoomed.

But would be great to get some rectangle when the image is centred to fill image view and not zoomed.

Something like a visible rectangle.

@hannesa2
Copy link
Collaborator

hannesa2 commented Feb 3, 2021

If it's missing, I'm happy to approve any contribution

@emartynov
Copy link
Contributor Author

Clear, let me implement it and contribute :)

So the algorithm is next:

  1. if the image is zoomed take zoomedRect
  2. else take drawable intrinsics apply scroll and find an intersection with view size

Or I need also apply scroll for zoomedRect?

Correct?

@hannesa2
Copy link
Collaborator

hannesa2 commented Feb 3, 2021

You spent more time with this questions, and it sounds smart to reflect on scroll the zoomedRect

@hannesa2
Copy link
Collaborator

hannesa2 commented Feb 3, 2021

Super nice would be an Activity to demonstrate the working implementation here
image

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

@stale stale bot added the stale label Apr 16, 2022
@hannesa2 hannesa2 removed the stale label Apr 17, 2022
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