ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.1k stars 1.55k forks source link

WRITE_EXTERNAL_STORAGE needed for SDK >= 19? #905

Open mattfysh opened 5 years ago

mattfysh commented 5 years ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related Android

Question

From SDK version >= 19, WRITE_EXTERNAL_STORAGE permission is no longer needed, if you're reading and writing to/from an app-specific location, from the docs:

Starting in API level 19, this permission is not required to read/write files in your application-specific directories returned by getExternalFilesDir(String) and getExternalCacheDir().

Link: https://developer.android.com/reference/android/Manifest.permission?hl=es#WRITE_EXTERNAL_STORAGE

Given that this library is only writing to its own location, and not needing read or write access to the remaining filesystem, this permission could be safely removed (or replaced with READ_EXTERNAL_STORAGE for accessing the photo gallery)

RHackrid commented 5 years ago

Same problem in following use-case: select multiple photos (without cropping/editing) ImagePicker.openPicker({ multiple: true, mediaType: "photo" });

The App does not need the permission WRITE_EXTERNAL_STORAGE but without this permission the previous call will return following error: Required permission missing

Please check the write-permissions only in case of writing. Link: https://developer.android.com/training/permissions/usage-notes

The permission READ_EXTERNAL_STORAGE should be necessary.

vebde commented 5 years ago

Hello,

My app clicks photo and sends it directly to the server without saving on device.

How can I allow user to crop the image without using WRITE_EXTERNAL_STORAGE permission?

Please help.

osrl commented 4 years ago

Even READ_EXTERNAL_STORAGE is not needed to read get image from gallery. Gallery app gives your app a URI base permission for only selected medias.