cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rkn...@apache.org
Subject cordova-plugin-camera git commit: CB-9169 android: Fixed filetype for uncompressed images and added quirk
Date Wed, 11 Nov 2015 01:35:09 GMT
Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master 88592575f -> 2bb134bf6


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


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/2bb134bf
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/2bb134bf
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/2bb134bf

Branch: refs/heads/master
Commit: 2bb134bf6bc627a2da07064057b502b06b076703
Parents: 8859257
Author: riknoll <richard.b.knoll@gmail.com>
Authored: Tue Nov 10 11:50:42 2015 -0800
Committer: riknoll <richard.b.knoll@gmail.com>
Committed: Tue Nov 10 17:26:07 2015 -0800

----------------------------------------------------------------------
 README.md                       | 4 +++-
 jsdoc2md/TEMPLATE.md            | 4 +++-
 src/android/CameraLauncher.java | 7 +++++++
 3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/2bb134bf/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 579b2fa..8060af9 100644
--- a/README.md
+++ b/README.md
@@ -408,7 +408,7 @@ Can only return photos as base64-encoded image.
 
 #### Firefox OS Quirks
 
-Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/).

+Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/).
 
 #### iOS Quirks
 
@@ -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.

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/2bb134bf/jsdoc2md/TEMPLATE.md
----------------------------------------------------------------------
diff --git a/jsdoc2md/TEMPLATE.md b/jsdoc2md/TEMPLATE.md
index 7ea3021..d068748 100644
--- a/jsdoc2md/TEMPLATE.md
+++ b/jsdoc2md/TEMPLATE.md
@@ -85,7 +85,7 @@ Can only return photos as base64-encoded image.
 
 #### Firefox OS Quirks
 
-Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/).

+Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/).
 
 #### iOS Quirks
 
@@ -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.

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/2bb134bf/src/android/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index fb056f4..2a1e62e 100644
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -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);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message