incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [49/50] git commit: Changed createCaptureFile to explicitly check for PNG and to throw an IllegalArgumentException if it is not a JPEG nor a PNG
Date Tue, 03 Jan 2012 18:57:12 GMT
Changed createCaptureFile to explicitly check for PNG and to throw an IllegalArgumentException
if it is not a JPEG nor a PNG

Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/affab67c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/affab67c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/affab67c

Branch: refs/heads/master
Commit: affab67ca34cd0bb2f48674bdc91fdfdde33a08c
Parents: cf9848b
Author: William Shen <williamshen01@gmail.com>
Authored: Thu Nov 3 18:41:08 2011 -0700
Committer: William Shen <williamshen01@gmail.com>
Committed: Thu Nov 3 18:41:08 2011 -0700

----------------------------------------------------------------------
 framework/src/com/phonegap/CameraLauncher.java |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/affab67c/framework/src/com/phonegap/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/CameraLauncher.java b/framework/src/com/phonegap/CameraLauncher.java
index a2a28b9..e1c5610 100755
--- a/framework/src/com/phonegap/CameraLauncher.java
+++ b/framework/src/com/phonegap/CameraLauncher.java
@@ -169,8 +169,10 @@ public class CameraLauncher extends Plugin {
         File photo = null;
         if (encodingType == JPEG) {
             photo = new File(DirectoryManager.getTempDirectoryPath(ctx),  "Pic.jpg");
-        } else {
+        } else if (encodingType == PNG) {
             photo = new File(DirectoryManager.getTempDirectoryPath(ctx),  "Pic.png");   
        
+        } else {
+            throw new IllegalArgumentException("Invalid Encoding Type: " + encodingType);
         }
         return photo;
     }


Mime
View raw message