All Projects → react-native-image-picker → React Native Image Picker

react-native-image-picker / React Native Image Picker

Licence: mit
🌄 A React Native module that allows you to use native UI to select media from the device library or directly from the camera.

Programming Languages

java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
typescript
32286 projects
javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language
Starlark
911 projects

Projects that are alternatives of or similar to React Native Image Picker

Facebookimagepicker
FacebookImagePicker is Facebook album photo picker written in Swift.
Stars: ✭ 220 (-97.04%)
Mutual labels:  picker, image-picker
Alerts And Pickers
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...
Stars: ✭ 5,267 (-29.12%)
Mutual labels:  picker, image-picker
Insgallery
📸 Instagram-like image picker for Android (一款 UI 炫酷高仿 Instagram 的图片、视频选择器)
Stars: ✭ 409 (-94.5%)
Mutual labels:  picker, image-picker
Kotlin Playground
Kotlin practice
Stars: ✭ 111 (-98.51%)
Mutual labels:  picker, image-picker
ProPicker
ProPicker is a file picker (image, video, file) library for Android. It helps you to pick any file and return the result in a convenient way
Stars: ✭ 25 (-99.66%)
Mutual labels:  image-picker, picker
Ypimagepicker
📸 Instagram-like image picker & filters for iOS
Stars: ✭ 3,661 (-50.73%)
Mutual labels:  picker, image-picker
React Native Syan Image Picker
React-Native 多图片选择 支持裁剪 压缩
Stars: ✭ 556 (-92.52%)
Mutual labels:  picker, image-picker
Linear Time Picker
Gorgeous Android Time and Date picker library inspired by the Timely app
Stars: ✭ 613 (-91.75%)
Mutual labels:  picker
Colorpicker
A mininal but complete colorpicker desktop app
Stars: ✭ 766 (-89.69%)
Mutual labels:  picker
Agcircularpicker
AGCircularPicker is helpful component for creating a controller aimed to manage any calculated parameter
Stars: ✭ 592 (-92.03%)
Mutual labels:  picker
Androidpicker
安卓选择器类库,包括日期及时间选择器(可用于出生日期、营业时间等)、单项选择器(可用于性别、民族、职业、学历、星座等)、二三级联动选择器(可用于车牌号、基金定投日期等)、城市地址选择器(分省级、地市级及区县级)、数字选择器(可用于年龄、身高、体重、温度等)、日历选日期择器(可用于酒店及机票预定日期)、颜色选择器、文件及目录选择器、图片选择器等……WheelPicker/DatePicker/TimePicker/OptionPicker/NumberPicker/LinkagePicker/AddressPicker/CarPlatePicker/CalendarPicker/ColorPicker/FilePicker/ImagePicker etc.
Stars: ✭ 5,320 (-28.41%)
Mutual labels:  picker
Imagepicker
📸Image Picker for Android, Pick an image from Gallery or Capture a new image with Camera
Stars: ✭ 623 (-91.62%)
Mutual labels:  image-picker
React Native Raw Bottom Sheet
Add Your Own Component To Bottom Sheet Whatever You Want (Android and iOS)
Stars: ✭ 771 (-89.62%)
Mutual labels:  picker
Prismasimpleimagepicker
This is a copy of the Prisma APP. Reproduce Prisma custom camera, image picker and picture editor
Stars: ✭ 594 (-92.01%)
Mutual labels:  image-picker
Bottomsheetpicker
BottomSheet picker to select one or multiple files. Allows taking photos / videos / select from camera gallery / pick a different file
Stars: ✭ 25 (-99.66%)
Mutual labels:  picker
Angular File Picker
A simple file picker for Angular
Stars: ✭ 9 (-99.88%)
Mutual labels:  picker
Singledateandtimepicker
You can now select a date and a time with only one widget !
Stars: ✭ 921 (-87.61%)
Mutual labels:  picker
Storage Chooser
Lets user choose files in internal or external storage with just few lines of code.
Stars: ✭ 689 (-90.73%)
Mutual labels:  picker
Wheelpicker
A smooth, highly customizable wheel view and picker view, support 3D effects like iOS. 一个顺滑的、高度自定义的滚轮控件和选择器,支持类似 iOS 的 3D 效果
Stars: ✭ 684 (-90.8%)
Mutual labels:  picker
Re Spinner
A spinner that supports item click events
Stars: ✭ 19 (-99.74%)
Mutual labels:  picker

React Native Image Picker

A React Native module that allows you to select a photo/video from the device library or camera.

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.

Install

yarn add react-native-image-picker

# RN >= 0.60
cd ios && pod install

# RN < 0.60
react-native link react-native-image-picker

Post-install Steps

iOS

Add the appropriate keys to your Info.plist,

If you are allowing user to select image/video from photos, add NSPhotoLibraryUsageDescription.

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

No permissions required (saveToPhotos requires permission check).

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.

API Reference

Methods

import {launchCamera, launchImageLibrary} from 'react-native-image-picker';

launchCamera()

Launch camera to take photo or video.

launchCamera(options?, callback);

// You can also use as a promise without 'callback':
const result = await launchCamera(options?);

See Options for further information on options.

The callback will be called with a response object, refer to The Response Object.

launchImageLibrary

Launch gallery to pick image or video.

launchImageLibrary(options?, callback)

// You can also use as a promise without 'callback':
const result = await launchImageLibrary(options?);

See Options for further information on options.

The callback will be called with a response object, refer to The Response Object.

Options

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)
includeExtra OK OK If true, will include extra data which requires library permissions to be requested (i.e. exif data)
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 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

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
type OK OK The file type (photos only)
fileName OK OK The file name
duration OK OK The selected video duration in seconds
bitrate --- OK The average bitrate (in bits/sec) of the selected video, if available. (Android only)
timestamp OK OK Timestamp of the photo. Only included if 'includeExtra' is true
id OK OK local identifier of the photo or video. On Android, this is the same as fileName

Note on file storage

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).

ErrorCode

Code Description
camera_unavailable camera not available on device
permission Permission not satisfied
others other errors (check errorMessage for description)

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].