TouchImageView icon indicating copy to clipboard operation
TouchImageView copied to clipboard

Question: Correct cropping params

Open emartynov opened this issue 4 years ago • 6 comments

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 avatar Feb 03 '21 11:02 emartynov

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.

emartynov avatar Feb 03 '21 11:02 emartynov

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

hannesa2 avatar Feb 03 '21 11:02 hannesa2

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?

emartynov avatar Feb 03 '21 11:02 emartynov

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

hannesa2 avatar Feb 03 '21 11:02 hannesa2

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

hannesa2 avatar Feb 03 '21 11:02 hannesa2

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[bot] avatar Apr 16 '22 15:04 stale[bot]