cordova-plugin-photo-album
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

cordova-plugin-photo-album

Cordova plugin for getting photo album.

Install

cordova plugin add cordova-plugin-photo-album

Before use

Before calling this plugin's method, you should first use the cordova.plugins.diagnostic plugin to determine the request permission. This plugin does not contain permission related logic.

Usage

Get albums

window.PhotoAlbum.getAlbums(
  (albums) => {
    // type is PhotoAlbum.Album[]
    console.log(albums);
  },
  (err) => {
    console.log(err);
  }
);

Get thumbnail

window.PhotoAlbum.getPhotoThumbnail(
  imgId,
  (base64) => {
    console.log(base64);
  },
  (err) => {
    console.log(err);
  }
);

Get origin picture data

On Android, using imgPath yields the original image without compression.

On iOS, the image obtained using imgId is a cropped image with a maximum width and height of 1024.

window.PhotoAlbum.getPhotoData(
  imgId,
  imgPath,
  (base64) => {
    console.log(base64);
  },
  (err) => {
    console.log(err);
  }
);

Package Sidebar

Install

npm i cordova-plugin-photo-album

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

22.5 kB

Total Files

9

Last publish

Collaborators

  • wtto00