Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wtto00/cordova-plugin-photo-album
Photo albums plugins for cordova
https://github.com/wtto00/cordova-plugin-photo-album
cordova cordova-plugin
Last synced: about 1 month ago
JSON representation
Photo albums plugins for cordova
- Host: GitHub
- URL: https://github.com/wtto00/cordova-plugin-photo-album
- Owner: wtto00
- License: mit
- Created: 2024-03-04T03:52:39.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-09T13:21:18.000Z (8 months ago)
- Last Synced: 2024-10-01T01:22:10.294Z (about 2 months ago)
- Topics: cordova, cordova-plugin
- Language: Java
- Homepage: https://www.npmjs.com/package/cordova-plugin-photo-album
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# cordova-plugin-photo-album
Cordova plugin for getting photo album.
## Install
```shell
cordova plugin add cordova-plugin-photo-album
```## Before use
Before calling this plugin's method, you should first use the [cordova.plugins.diagnostic](https://www.npmjs.com/package/cordova.plugins.diagnostic) plugin to determine the request permission. This plugin does not contain permission related logic.
## Usage
### Get albums
```typescript
window.PhotoAlbum.getAlbums(
(albums) => {
// type is PhotoAlbum.Album[]
console.log(albums);
},
(err) => {
console.log(err);
}
);
```### Get thumbnail
```ts
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.
```ts
window.PhotoAlbum.getPhotoData(
imgId,
imgPath,
(base64) => {
console.log(base64);
},
(err) => {
console.log(err);
}
);
```