0.1.2 • Published 5 years ago

cap-photo-roll v0.1.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

cap-photo-roll

npm version

A Capacitor API for retrieving Photos from your device Camera Roll.

It's a Work in Progress. It's published so I thought it would be easier for me to test it. After 0.1.1, I'll branch out to development and publish it more sparsely after remembering that I could install from the repo.

As of 0.1.1, it fetches after second opening of the app the most recent photo on iOS and an encoded image on Android.

Android X support may come after Capacitor 2.0.0 is released.

Installation

npm i --save cap-photo-roll

Usage

Angular

import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { Plugins } from '@capacitor/core';

const { PhotoRoll } = Plugins;

@Component({
    selector: 'app-gallery',
    template: '<img [src]="domSanitizer.bypassSecurityTrustUrl(lastPhoto)" />'
})
export class GalleryPage {
    private lastPhoto = '';

    async getPhoto() {
        const latestPhoto = await PhotoRoll.getLastPhotoTaken();

        this.lastPhoto = 'data:image/png;base64, ' + result.image;
    }
}
0.1.2

5 years ago

0.1.0

5 years ago

0.1.1

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago