CB-9169 android: Fixed filetype for uncompressed images and added quirk

This commit is contained in:
riknoll 2015-11-10 11:50:42 -08:00
parent 88592575fe
commit 2bb134bf6b
3 changed files with 13 additions and 2 deletions

View File

@ -451,6 +451,8 @@ Tizen only supports a `destinationType` of
- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.
- Ignores the `encodingType` parameter if the image is unedited (i.e. `quality` is 100, `correctOrientation` is false, and no `targetHeight` or `targetWidth` are specified). The `CAMERA` source will always return the JPEG file given by the native camera and the `PHOTOLIBRARY` and `SAVEDPHOTOALBUM` sources will return the selected file in its existing encoding.
#### BlackBerry 10 Quirks
- Ignores the `quality` parameter.

View File

@ -128,6 +128,8 @@ Tizen only supports a `destinationType` of
- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.
- Ignores the `encodingType` parameter if the image is unedited (i.e. `quality` is 100, `correctOrientation` is false, and no `targetHeight` or `targetWidth` are specified). The `CAMERA` source will always return the JPEG file given by the native camera and the `PHOTOLIBRARY` and `SAVEDPHOTOALBUM` sources will return the selected file in its existing encoding.
#### BlackBerry 10 Quirks
- Ignores the `quality` parameter.

View File

@ -162,6 +162,13 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
this.targetHeight = -1;
}
// We don't return full-quality PNG files. The camera outputs a JPEG
// so requesting it as a PNG provides no actual benefit
if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
!this.correctOrientation && this.encodingType == PNG && this.srcType == CAMERA) {
this.encodingType = JPEG;
}
try {
if (this.srcType == CAMERA) {
this.callTakePicture(destType, encodingType);