forked from github/cordova-android
Merge pull request #14 from willshen/master
Modified createCaptureFile in CameraLauncher to Improve Encoding Type Safety
This commit is contained in:
commit
119f6cca85
@ -180,8 +180,10 @@ public class CameraLauncher extends Plugin {
|
|||||||
File photo = null;
|
File photo = null;
|
||||||
if (encodingType == JPEG) {
|
if (encodingType == JPEG) {
|
||||||
photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Pic.jpg");
|
photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Pic.jpg");
|
||||||
} else {
|
} else if (encodingType == PNG) {
|
||||||
photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Pic.png");
|
photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Pic.png");
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Invalid Encoding Type: " + encodingType);
|
||||||
}
|
}
|
||||||
return photo;
|
return photo;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user