[BUG] - Null bitmap provided to OnCropImageCompleteListener
See original GitHub issue- Lib Version [e.g. 3.3.4-4.2.1]
Describe the bug
I’ve upgraded the library and now I’m getting null
bitmap in CropResult
provided to the listener set using setOnCropImageCompleteListener
. Interestingly isSuccessful
is true
and error
is null
.
The project is using CropImageView
integration. The only change I needed to do when updating was to change getCroppedImageAsync()
to croppedImageAsync()
.
The project is using Java 8, had issues upgrading it to Java 11. The files integrating with the library are in Kotlin. Not sure if it’s not Java 8 issue but I would expect any such issues to be more likely build-time issues, not such an odd runtime issue of bitmap being null
right at the end of the flow.
To Reproduce Steps to reproduce the behavior:
- Use view integration
- setOnCropImageCompleteListener
- setImageBitmap
- croppedImageAsync()
Expected behavior
cropResult.bitmap provided to the listener should not be null
Please help/advise.
Issue Analytics
- State:
- Created a year ago
- Comments:15 (8 by maintainers)
Top GitHub Comments
Maybe the sample was too basic. The view was not yet measured when I requested immediately
croppedImageAsync()
and perhaps that caused the error. Now added OK button to triggercroppedImageAsync()
and I’m getting the same outcome as in the real project I’m working on. That’s what I see after callingcroppedImageAsync()
, the last 3 log entries are properties ofCropImageView.CropResult
received in the callback:I created a basic sample that reproduced the issue and linked to it in that comment.
Addressing the earlier question, it didn’t feel like worth looking for a work around really, just didn’t upgrade beyond the version that has introduced the regression.
I’m no loner working on the project were the bug prevented the library upgrade so will be unsubscribing from this thread but definitely if feels like something worth fixing for the active users of the library.