cordova-plugin-camera icon indicating copy to clipboard operation
cordova-plugin-camera copied to clipboard

Auto-detect encodingType for loading from photo album

Open jwasnoggin opened this issue 5 years ago • 0 comments

Feature Request

Motivation Behind Feature

When adding a photo from the gallery/photo album, you have to specify the encoding type in advance (either JPEG or PNG). But ideally it would be good to just load the file from the device without modifying it.

Feature Description

Rather than converting the file to the specified type, it would be good to have an option to use the existing type. Eg:

var cam = navigator.camera;
var options = {
    sourceType: cam.PictureSourceType.SAVEDPHOTOALBUM,
    destinationType: cam.DestinationType.FILE_URI,
    options.mediaType = cam.MediaType.PICTURE;
    options.encodingType = cam.MediaType.AUTO; // Use the filetype of the existing file
}
cam.getPicture(gotMediaFn, errorFn, options);

Alternatives or Workarounds

The only option that I can see currently is to always convert the file to either JPEG or PNG.

jwasnoggin avatar Mar 09 '20 03:03 jwasnoggin