From 5ceb6e2cfada8c1d52c3007eb43589c77ca2fa0d Mon Sep 17 00:00:00 2001 From: William Shen Date: Thu, 3 Nov 2011 18:41:08 -0700 Subject: [PATCH] Changed createCaptureFile to explicitly check for PNG and to throw an IllegalArgumentException if it is not a JPEG nor a PNG --- framework/src/com/phonegap/CameraLauncher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/com/phonegap/CameraLauncher.java b/framework/src/com/phonegap/CameraLauncher.java index 9dd5d0c1..dd619a24 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; }