ArthurHub / ArthurHub/Android-Image-Cropper

setCropRect() method's wrong behavior (bug)

Open
#570 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

I am trying to adapt the library to multiple images usage. So, i have a `RecyclerView `below the `CropImageView `in the layout. Whenever i choose an image from the list, i add it to the `CropImageView `and save its crop overlay position using `CropImageView.OnSetCropOverlayMovedListener`.
However, when i select back that same image and use `setCropRect()` method, it doesn't restore to the correct crop overlay position.
This happens only with high res portrait photos.

I attached an animated gif to make the bug clearer.

![device-2018-07-10-114138 3 -min](https://user-images.githubusercontent.com/22471667/42506432-2f384142-8442-11e8-8237-fff89e309b22.gif)

As you can see, when i select back the first photo, the crop overlay zone changes randomly.
Debugging shows that the `Rect `value provided by `getCropRect()` and `onCropOverlayMoved()` methods is the same used in the `setCropRect()` method.

Any help is greatly appreciated!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.