RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 407 forks source link

Fix a crash when trying to access with size of a Photo #347

Closed ansman closed 5 years ago

ansman commented 5 years ago

BitmapFactory.decodeByteArray returns null when inJustDecodeBounds == true, the proper way to read the size is to read the outWidth and outHeight properties of the options after the call.

ansman commented 5 years ago

Another way to fix the issue is to simply use the size from camera properties instead of decoding the size from the byte array.

Diolor commented 5 years ago

Hey! Thanks! I just read the docs and using outXXX looks the correct way to go!