Changed createCaptureFile to explicitly check for PNG and to throw an IllegalArgumentException if it is not a JPEG nor a PNG

This commit is contained in:
William Shen 2011-11-03 18:41:08 -07:00 committed by Joe Bowser
parent 035ad08c69
commit 5ceb6e2cfa

View File

@ -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;
}