Socket
Socket
Sign inDemoInstall

react-native-image-picker

Package Overview
Dependencies
Maintainers
7
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-image-picker - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

2

lib/typescript/types.d.ts
export declare type Callback = (response: ImagePickerResponse) => any;
export interface ImageLibraryOptions {
allowMultiple?: boolean;
selectionLimit?: number;
mediaType: MediaType;

@@ -5,0 +5,0 @@ maxWidth?: number;

{
"name": "react-native-image-picker",
"version": "4.0.0",
"version": "4.0.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",

@@ -5,0 +5,0 @@ "react-native": "src/index.ts",

@@ -10,10 +10,6 @@ # React Native Image Picker

**Note:** If you are still using deprecated version 2.x.x [check](https://github.com/react-native-image-picker/react-native-image-picker/tree/2.3.4) this for documentation.
### Make sure you're reading the doc applicable to your version, for example if your using version 3.8.0 go to tag 3.8.0 and read those docs. This doc is always that of main branch.
### Also read version release notes for any breaking changes especially if you're updating the major version.
## Migration from 2.x.x to 3.x.x
- `showImagePicker` API is removed.
- No permission required for default `options` on Android.
- Removed and updated some values in `options`, so please check them carefully.
# Install

@@ -83,30 +79,37 @@

| Option | iOS | Android | Description |
| ------------- | --- | ------- | ------------------------------------------------------------------------------------------------- |
| Option | iOS | Android | Description |
| ------------- | --- | ------- | ----------------------------------------------------------------------------------------------------- |
| mediaType | OK | OK | 'photo' or 'video' or 'mixed'(mixed supported only for launchImageLibrary, to pick an photo or video) |
| maxWidth | OK | OK | To resize the image |
| maxHeight | OK | OK | To resize the image |
| videoQuality | OK | OK | 'low', 'medium', or 'high' on iOS, 'low' or 'high' on Android |
| durationLimit | OK | OK | Video max duration in seconds |
| quality | OK | OK | 0 to 1, photos |
| cameraType | OK | OK | 'back' or 'front'. May not be supported in few android devices |
| includeBase64 | OK | OK | If true, creates base64 string of the image (Avoid using on large image files due to performance) |
| saveToPhotos | OK | OK | (Boolean) Only for launchCamera, saves the image/video file captured to public photo |
| maxWidth | OK | OK | To resize the image |
| maxHeight | OK | OK | To resize the image |
| videoQuality | OK | OK | 'low', 'medium', or 'high' on iOS, 'low' or 'high' on Android |
| durationLimit | OK | OK | Video max duration in seconds |
| quality | OK | OK | 0 to 1, photos |
| cameraType | OK | OK | 'back' or 'front'. May not be supported in few android devices |
| includeBase64 | OK | OK | If true, creates base64 string of the image (Avoid using on large image files due to performance) |
| saveToPhotos | OK | OK | (Boolean) Only for launchCamera, saves the image/video file captured to public photo |
| selectionLimit| OK | OK | Default is `1`, use `0` to allow any number of files. Only iOS version >= 14 support `0` and also it supports providing any integer value|
## The Response Object
| key | iOS | Android | Description |
| ------------ | --- | ------- | --------------------------------------------------------------------------------------------------------------- |
| didCancel | OK | OK | `true` if the user cancelled the process |
| errorCode | OK | OK | Check [ErrorCode](#ErrorCode) for all error codes |
| errorMessage | OK | OK | Description of the error, use it for debug purpose only |
| base64 | OK | OK | The base64 string of the image (photos only) |
| uri | OK | OK | The file uri in app specific cache storage. Except when picking **video from Android gallery** where you will get read only content uri, to get file uri in this case copy the file to app specific storage using any react-native library|
| width | OK | OK | Image dimensions (photos only) |
| height | OK | OK | Image dimensions (photos only) |
| fileSize | OK | OK | The file size (photos only) |
| type | OK | OK | The file type (photos only) |
| fileName | OK | OK | The file name |
| duration | OK | OK | The selected video duration in seconds |
| key | iOS | Android | Description |
| --------------------------- | --- | ------- | ------------------------------------------------------- |
| didCancel | OK | OK | `true` if the user cancelled the process |
| errorCode | OK | OK | Check [ErrorCode](#ErrorCode) for all error codes |
| errorMessage | OK | OK | Description of the error, use it for debug purpose only |
| assets | OK | OK | Array of the selected media, [refer to Asset Object](#Asset-Object) |
## Asset Object
| key | iOS | Android | Description |
| -------- | --- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| base64 | OK | OK | The base64 string of the image (photos only) |
| uri | OK | OK | The file uri in app specific cache storage. Except when picking **video from Android gallery** where you will get read only content uri, to get file uri in this case copy the file to app specific storage using any react-native library |
| width | OK | OK | Image dimensions (photos only) |
| height | OK | OK | Image dimensions (photos only) |
| fileSize | OK | OK | The file size (photos only) |
| type | OK | OK | The file type (photos only) |
| fileName | OK | OK | The file name |
| duration | OK | OK | The selected video duration in seconds |
## Note on file storage

@@ -113,0 +116,0 @@

@@ -14,3 +14,3 @@ import {NativeModules} from 'react-native';

cameraType: 'back',
allowMultiple: false,
selectionLimit: 1,
saveToPhotos: false,

@@ -17,0 +17,0 @@ durationLimit: 0,

export type Callback = (response: ImagePickerResponse) => any;
export interface ImageLibraryOptions {
allowMultiple?: boolean;
selectionLimit?: number;
mediaType: MediaType;

@@ -6,0 +6,0 @@ maxWidth?: number;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc