incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [7/10] git commit: Changed createCaptureFile to explicitly check for PNG and to throw an IllegalArgumentException if it is not a JPEG nor a PNG
Date Fri, 06 Jan 2012 23:52:42 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/5ceb6e2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/5ceb6e2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/5ceb6e2c

Branch: refs/heads/master
Commit: 5ceb6e2cfada8c1d52c3007eb43589c77ca2fa0d
Parents: 035ad08
Author: William Shen <williamshen01@gmail.com>
Authored: Thu Nov 3 18:41:08 2011 -0700
Committer: Joe Bowser <joe.bowser@nitobi.com>
Committed: Fri Nov 25 14:38:09 2011 -0800

----------------------------------------------------------------------
 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/5ceb6e2c/framework/src/com/phonegap/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/CameraLauncher.java b/framework/src/com/phonegap/CameraLauncher.java
index 9dd5d0c..dd619a2 100755
--- a/framework/src/com/phonegap/CameraLauncher.java
+++ b/framework/src/com/phonegap/CameraLauncher.java
@@ -180,8 +180,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