apache / apache/cordova-plugin-camera

Auto-detect encodingType for loading from photo album

Open
#568 0 comments 1 reaction 0 assignees View on GitHub
enhancement feature
Dominant language
Objective-C
Stars
976
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

# 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.

Contributor guide

Open the contributing guide

Research direction

Start at the getPicture entry point and trace how SAVEDPHOTOALBUM, FILE_URI, and encodingType are handled on each mobile platform. Determine how an automatic encoding option should preserve the selected file's existing type, then verify that existing JPEG and PNG behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, objective-c
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.