Phonegap - Choose Image From Gallery

后端 未结 6 976
不思量自难忘°
不思量自难忘° 2020-12-02 23:30

Can anyone tell me, or point me in the direction of how to get an image from the phone\'s image gallery in Phonegap / Android? There\'s docs on accessing the camera (which w

6条回答
  •  -上瘾入骨i
    2020-12-03 00:00

    I'm working on cordova-plugin-photo-library plugin which provides cross-platform way to enumerate through all photos on device.

    Usage:

    cordova.plugins.photoLibrary.getLibrary(function (library) {
        // Here we have the library as array
        cordova.plugins.photoLibrary.getThumbnailUrl(library[0],
            function (thumbnailUrl) { image.src = thumbnailUrl; },
            function (err) { console.log('Error occured'); },
            {
                thumbnailWidth: 512,
                thumbnailHeight: 384,
                quality: 0.8
            });
        });

提交回复
热议问题