Socket
Socket
Sign inDemoInstall

react-native-image-picker

Package Overview
Dependencies
514
Maintainers
7
Versions
212
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.6.0 to 5.6.1

14

lib/typescript/types.d.ts

@@ -1,2 +0,2 @@

export declare type Callback = (response: ImagePickerResponse) => any;
export type Callback = (response: ImagePickerResponse) => any;
export interface OptionsCommon {

@@ -41,7 +41,7 @@ mediaType: MediaType;

}
export declare type PhotoQuality = 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;
export declare type CameraType = 'back' | 'front';
export declare type MediaType = 'photo' | 'video' | 'mixed';
export declare type AndroidVideoOptions = 'low' | 'high';
export declare type iOSVideoOptions = 'low' | 'medium' | 'high';
export declare type ErrorCode = 'camera_unavailable' | 'permission' | 'others';
export type PhotoQuality = 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;
export type CameraType = 'back' | 'front';
export type MediaType = 'photo' | 'video' | 'mixed';
export type AndroidVideoOptions = 'low' | 'high';
export type iOSVideoOptions = 'low' | 'medium' | 'high';
export type ErrorCode = 'camera_unavailable' | 'permission' | 'others';
{
"name": "react-native-image-picker",
"version": "5.6.0",
"version": "5.6.1",
"description": "A React Native module that allows you to use native UI to select media from the device library or directly from the camera",

@@ -43,7 +43,7 @@ "react-native": "src/index.ts",

"@react-native-community/bob": "0.17.1",
"@semantic-release/git": "9.0.0",
"@types/react": "18.0.28",
"@types/react-native": "0.71.3",
"semantic-release": "17.3.0",
"typescript": "4.1.5"
"@semantic-release/git": "10.0.1",
"@types/react": "18.2.13",
"@types/react-native": "0.72.2",
"semantic-release": "21.0.5",
"typescript": "5.1.3"
},

@@ -50,0 +50,0 @@ "@react-native-community/bob": {

@@ -27,5 +27,5 @@ # react-native-image-picker 🎆

Set `newArchEnabled` to true inside `android/gradle.properties`
Set `newArchEnabled` to `true` inside `android/gradle.properties`
### Pre-Fabric (aka not using the new architecture)
### Pre-Fabric (AKA not using the new architecture)

@@ -40,10 +40,10 @@ ```bash

Add the appropriate keys to your Info.plist,
Add the appropriate keys to your `Info.plist` depending on your requirement:
If you are allowing user to select image/video from photos, add `NSPhotoLibraryUsageDescription`.
| Requirement | Key |
| ------------------------------ | --------------------------------------------------- |
| Select image/video from photos | NSPhotoLibraryUsageDescription |
| Capture Image | NSCameraUsageDescription |
| Capture Video | NSCameraUsageDescription & NSCameraUsageDescription |
If you are allowing user to capture image add `NSCameraUsageDescription` key also.
If you are allowing user to capture video add `NSCameraUsageDescription` add `NSMicrophoneUsageDescription` key also.
### Android

@@ -53,3 +53,3 @@

Note: This library does not require Manifest.permission.CAMERA, if your app declares as using this permission in manifest then you have to obtain the permission before using `launchCamera`.
Note: This library does not require `Manifest.permission.CAMERA`, if your app declares as using this permission in manifest then you have to obtain the permission before using `launchCamera`.

@@ -96,20 +96,20 @@ ## API Reference

| Option | iOS | Android | Web | Description |
| ----------------- | --- | ------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| mediaType | OK | OK | OK | 'photo' or 'video' or 'mixed'(launchCamera on Android does not support 'mixed'). Web only supports 'photo' for now. |
| maxWidth | OK | OK | NO | To resize the image |
| maxHeight | OK | OK | NO | To resize the image |
| videoQuality | OK | OK | NO | 'low', 'medium', or 'high' on iOS, 'low' or 'high' on Android |
| durationLimit | OK | OK | NO | Video max duration in seconds |
| quality | OK | OK | NO | 0 to 1, photos |
| cameraType | OK | OK | NO | 'back' or 'front'. May not be supported in few android devices |
| includeBase64 | OK | OK | OK | If true, creates base64 string of the image (Avoid using on large image files due to performance) |
| includeExtra | OK | OK | NO | If true, will include extra data which requires library permissions to be requested (i.e. exif data) |
| saveToPhotos | OK | OK | NO | (Boolean) Only for launchCamera, saves the image/video file captured to public photo |
| selectionLimit | OK | OK | OK | Default is `1`, use `0` to allow any number of files. Only iOS version >= 14 & Android version >= 13 support `0` and also it supports providing any integer value |
| presentationStyle | OK | NO | NO | Controls how the picker is presented. 'pageSheet', 'fullScreen', 'pageSheet', 'formSheet', 'popover', 'overFullScreen', 'overCurrentContext'. Default is 'currentContext' |
| formatAsMp4 | OK | NO | NO | Converts the selected video to MP4. iOS Only. |
| assetRepresentationMode | OK | NO | NO | A mode that determines which representation to use if an asset contains more than one. Possible values: 'auto', 'current', 'compatible'. Default is 'auto' |
|
| Option | iOS | Android | Web | Description |
| ----------------------- | --- | ------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| mediaType | OK | OK | OK | `photo` or `video` or `mixed`(`launchCamera` on Android does not support 'mixed'). Web only supports 'photo' for now. |
| maxWidth | OK | OK | NO | To resize the image. |
| maxHeight | OK | OK | NO | To resize the image. |
| videoQuality | OK | OK | NO | `low`, `medium`, or `high` on iOS, `low` or `high` on Android. |
| durationLimit | OK | OK | NO | Video max duration (in seconds). |
| quality | OK | OK | NO | 0 to 1, photos. |
| cameraType | OK | OK | NO | 'back' or 'front' (May not be supported in few android devices). |
| includeBase64 | OK | OK | OK | If `true`, creates base64 string of the image (Avoid using on large image files due to performance). |
| includeExtra | OK | OK | NO | If `true`, will include extra data which requires library permissions to be requested (i.e. exif data). |
| saveToPhotos | OK | OK | NO | (Boolean) Only for `launchCamera`, saves the image/video file captured to public photo. |
| selectionLimit | OK | OK | OK | Supports providing any integer value. Use `0` to allow any number of files on iOS version >= 14 & Android version >= 13. Default is `1`. |
| presentationStyle | OK | NO | NO | Controls how the picker is presented. `currentContext`, `pageSheet`, `fullScreen`, `formSheet`, `popover`, `overFullScreen`, `overCurrentContext`. Default is `currentContext`. |
| formatAsMp4 | OK | NO | NO | Converts the selected video to MP4 (iOS Only). |
| assetRepresentationMode | OK | NO | NO | A mode that determines which representation to use if an asset contains more than one. Possible values: 'auto', 'current', 'compatible'. Default is 'auto'. |
## The Response Object

@@ -142,5 +142,5 @@

Image/video captured via camera will be stored in temporary folder so will be deleted any time, so don't expect it to persist. Use `saveToPhotos: true` (default is false) to save the file in the public photos. `saveToPhotos` requires WRITE_EXTERNAL_STORAGE permission on Android 28 and below (You have to obtain the permission, the library does not).
Image/video captured via camera will be stored in temporary folder allowing it to be deleted any time, so don't expect it to persist. Use `saveToPhotos: true` (default is `false`) to save the file in the public photos. `saveToPhotos` requires `WRITE_EXTERNAL_STORAGE` permission on Android 28 and below (The permission has to obtained by the App manually as the library does not handle that).
For web this doesn't work.
For web, this doesn't work.

@@ -151,5 +151,5 @@ ## ErrorCode

| ------------------ | ------------------------------------------------- |
| camera_unavailable | camera not available on device |
| camera_unavailable | Camera not available on device |
| permission | Permission not satisfied |
| others | other errors (check errorMessage for description) |
| others | Other errors (check errorMessage for description) |

@@ -156,0 +156,0 @@ ## License

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc