Skip to content

Commit

Permalink
[android] filter possible image types for cropping (#1421)
Browse files Browse the repository at this point in the history
Now `react-native-image-crop-picker` allow to choose any `image/*` file for cropping. But related to Yalantis/uCrop#166 (comment) only `libjpeg` and `libpng` under the hood libUCrop. So I think will be useful to filter image files only ready for cropping
  • Loading branch information
oxyii authored Oct 1, 2020
1 parent 5516823 commit 9838f53
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ private void initiatePicker(final Activity activity) {

if (cropping || mediaType.equals("photo")) {
galleryIntent.setType("image/*");
String[] mimetypes = {"image/jpeg", "image/png"};
galleryIntent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
} else if (mediaType.equals("video")) {
galleryIntent.setType("video/*");
} else {
Expand Down

0 comments on commit 9838f53

Please sign in to comment.