🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

expo-image-picker

Package Overview
Dependencies
Maintainers
27
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-image-picker

Provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera.

16.1.4
latest
Source
npm
Version published
Weekly downloads
380K
0.73%
Maintainers
27
Weekly downloads
 
Created

What is expo-image-picker?

The expo-image-picker package allows you to access the device's media library and camera to pick images and videos. It provides a simple and consistent interface for both iOS and Android platforms.

What are expo-image-picker's main functionalities?

Pick an image from the library

This feature allows users to pick an image from their device's media library. The code sample demonstrates how to launch the image library and handle the selected image.

import * as ImagePicker from 'expo-image-picker';

async function pickImage() {
  let result = await ImagePicker.launchImageLibraryAsync({
    mediaTypes: ImagePicker.MediaTypeOptions.Images,
    allowsEditing: true,
    aspect: [4, 3],
    quality: 1,
  });

  if (!result.canceled) {
    console.log(result.uri);
  }
}

Take a photo using the camera

This feature allows users to take a photo using their device's camera. The code sample demonstrates how to launch the camera and handle the captured photo.

import * as ImagePicker from 'expo-image-picker';

async function takePhoto() {
  let result = await ImagePicker.launchCameraAsync({
    allowsEditing: true,
    aspect: [4, 3],
    quality: 1,
  });

  if (!result.canceled) {
    console.log(result.uri);
  }
}

Pick a video from the library

This feature allows users to pick a video from their device's media library. The code sample demonstrates how to launch the video library and handle the selected video.

import * as ImagePicker from 'expo-image-picker';

async function pickVideo() {
  let result = await ImagePicker.launchImageLibraryAsync({
    mediaTypes: ImagePicker.MediaTypeOptions.Videos,
    allowsEditing: true,
    quality: 1,
  });

  if (!result.canceled) {
    console.log(result.uri);
  }
}

Take a video using the camera

This feature allows users to take a video using their device's camera. The code sample demonstrates how to launch the camera and handle the captured video.

import * as ImagePicker from 'expo-image-picker';

async function takeVideo() {
  let result = await ImagePicker.launchCameraAsync({
    mediaTypes: ImagePicker.MediaTypeOptions.Videos,
    allowsEditing: true,
    quality: 1,
  });

  if (!result.canceled) {
    console.log(result.uri);
  }
}

Other packages similar to expo-image-picker

Keywords

react-native

FAQs

Package last updated on 30 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts