lyft / scissors

✂ Android image cropping library
https://eng.lyft.com/scissors-an-image-cropping-library-for-android-a56369154a19
Apache License 2.0
1.84k stars 235 forks source link

Viewport Ratio not correct when setImageURI is used. #52

Closed malacavilla closed 8 years ago

malacavilla commented 8 years ago

I have code such as:

cropView.setImageURI(imageFileUri);
cropView.setViewportRatio(viewportRatioValue);

The only time the TouchManager's setViewport() code is called is when the we set the viewport. However at this state, the bitmap width/height is 0 (because the Bitmap isn't loaded yet), so we get an imageAspect of NaN, making our viewport non-existent.

malacavilla commented 8 years ago

This is actually not an issue, see now that it is calculating after Bitmap is set.