igreenwood / SimpleCropView

A simple image cropping library for Android.
MIT License
2.48k stars 466 forks source link

Setting Drawable to SimpleCropView causes undefined behavior #12

Closed rdzha closed 8 years ago

rdzha commented 9 years ago

Very nice and clean library!

I was trying to use it with Picasso. Images load just fine, they show up, but without cropping frame. Also, trying to rotate CropView with the new rotation method causes crash:

Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference at com.isseiaoki.simplecropview.CropImageView.rotateImage(CropImageView.java:972)

The actual reason is that Picasso uses PicassoDrawable internally to load images into ImageViews. And SimpleCropView doesn't have corresponding method overloaded. As a workaround, I use callback to get bitmap and set it directly to CropView. But it would be nice if it worked out of box.

igreenwood commented 8 years ago

@rdzha

Hi,

Version 1.0.9 has been released. I added setImageDrawable()

I hope this helps : )