apache / apache/cordova-plugin-camera
MIME-type filter for selecting from PHOTO ALBUM
- Dominant language
- Objective-C
- Stars
- 976
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
# Feature Request
MIME-type filter for selecting from PHOTO ALBUM
## Motivation Behind Feature
Give the plugin the ability to select only certain MIME types of images. For example, this could help limit the options down to .jpeg and .png only on Android. Thus, it could prevent the users from picking .psd files from their library.
## Feature Description
As a developer using this plugin I would like to have a configurable option to filter certain MIME types that I want only. Something that can be done via the `cameraOptions` like:
```
navigator.camera.getPicture(onBrowsePhotoSuccess, onBrowsePhotoFailed, {
sourceType: pictureSource.PHOTOLIBRARY,
mimeTypes: ["jpeg", "png",...] // only works when sourceType is not CAMERA.
});
```
## Alternatives or Workarounds
Our current workaround is relying on the returned file URI from the success callback and use regex to determine if the file type is valid or not.
Contributor guide
Assessment
This issue has not been assessed yet.