-
-
Notifications
You must be signed in to change notification settings - Fork 292
fix NPE in BitmapShrinker #5612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| // solution inspired by https://developer.android.com/topic/performance/graphics/load-bitmap | ||
| private fun decodeBitmap(path: String, requestedWidth: Int, requestedHeight: Int): Bitmap = | ||
| private fun decodeBitmap(path: String, requestedWidth: Int, requestedHeight: Int): Bitmap? = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try out some things why it actually fails?
E.g. did you try with specials chars in path like in the other recent PR? So the same fix could be applied..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will happen due to an invalid or corrupt file, or if the bitmap is too large(running out of memory during decoding). In all these cases, decodeFile() returns null instead of an exception.
7ff7044 to
aa9bd48
Compare
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
aa9bd48 to
e408160
Compare
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/5612.apk |

fix #5600
🚧 TODO
🏁 Checklist
/backport to stable-xx.x