android-imagecropview icon indicating copy to clipboard operation
android-imagecropview copied to clipboard

ClassCastException in getViewBitmap()

Open rupinderjeet opened this issue 5 years ago • 3 comments

If I set a source like this,

cropView.setImageResource(R.drawable.ic_launcher)

And, set crop portion like this,

cropView.setAspectRatio(1, 1)

And, then, get crop-info like this,

cropView.getCropInfo()

It crashes with Bitmap can't be cast to FastBitmapDrawable.

rupinderjeet avatar Mar 30 '20 10:03 rupinderjeet

Hi, @rupinderjeet I'm sorry. Actually this library is supporting only setImageFilePath method for image load. setImageResource is not supported. I need to update Usage in README.md

Thank you.

helloyako avatar Mar 30 '20 13:03 helloyako

You should instead throw an exception in these methods if they aren't supported. If someone calls setImageResource throw execption to tell user to not use this method.

rupinderjeet avatar Mar 30 '20 14:03 rupinderjeet

@rupinderjeet OK! I will update that.

helloyako avatar Mar 30 '20 14:03 helloyako