Skip to content

Auto-detect encodingType for loading from photo album #568

Open
@jwasnoggin

Description

@jwasnoggin

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions