mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
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:
parent
cf9848bd59
commit
affab67ca3
@ -169,8 +169,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