(android) more efficient bitmap decoding

This commit is contained in:
Ivan Pusic 2017-03-07 10:00:02 +01:00
parent a892a7e432
commit 2b04e10b4f
2 changed files with 4 additions and 1 deletions

View File

@ -487,6 +487,9 @@ class PickerModule extends ReactContextBaseJavaModule implements ActivityEventLi
private BitmapFactory.Options validateImage(String path) throws Exception {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
options.inPreferredConfig = Bitmap.Config.RGB_565;
options.inDither = true;
BitmapFactory.decodeFile(path, options);
if (options.outMimeType == null || options.outWidth == 0 || options.outHeight == 0) {

View File

@ -1,6 +1,6 @@
{
"name": "react-native-image-crop-picker",
"version": "0.12.7",
"version": "0.12.8",
"description": "Select single or multiple images, with croping option",
"main": "index.js",
"scripts": {