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
parent cf9848bd59
commit affab67ca3

View File

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