Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expo-image-picker

Package Overview
Dependencies
Maintainers
28
Versions
121
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.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
196K
decreased by-10.68%
Maintainers
28
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

FAQs

Package last updated on 22 Nov 2024

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

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