🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@hkbautistav/cordova-plugin-camera-roll

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hkbautistav/cordova-plugin-camera-roll

Cordova Camera Roll Plugin Ios - Fork by HillaryBautista

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
0
Created
Source

Cordova Camera Roll

The Cordova Camera Roll plugin makes it easy to read from the camera roll.

Cordova comes with some camera features such as navigator.camera.getPicture. The problem is you have no control over the experience beyond that. On iOS, for example, a modal slides in that lets you choose a picture.

With this plugin you can get a list of all photos and do whatever you want with them after that.

Installation

cordova plugin add @hkbautistav/cordova-plugin-camera-roll

Usage


CameraRoll.getPhotos(function(photo) {
  // `photo` is an object with `path`, `date`,
  // `thumbnailPath` (android only) and `orientation` (in degrees) (android only).
  //
  // On iOS, paths are prefixed asset-library://
  // So if you are using Angular and ng-src, make sure to whitelist this URL scheme.
  //
  // You can use the paths directly in an img src or as a background-image in CSS.
  //
  // This callback will be called for each photo in the roll. It's async, yo!
  //
  // When the last photo is reached, the callback is called one last time with an empty object.
}, function(err) {
  // Something bad happened :O
}, {
  count: 12, // Optional, will only return the last N photos.
});

// (iOS only) Quickly save a base-64 encoded data uri to the camera roll.
CameraRoll.saveToCameraRoll(base64String, function() {
  // File saved
}, function(err) {
  // Something bad happened :O
});

About this module

Originally created by Max Lynch @maxlynch, with Android support by Jeremy Bouillanne johnnyoin.

Tested on Cordova android 5.1.1 and Cordova ios 4.1.1.

TODO

  • Change the interface to have a single success callback called once, with the full list of photos.

Keywords

ionic

FAQs

Package last updated on 27 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