Skip to content

Commit

Permalink
Fix extension name image file.
Browse files Browse the repository at this point in the history
  • Loading branch information
José Fernando Castañeda Estrada committed Apr 10, 2015
1 parent 0d41c59 commit da8468b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public static final void capture(Webcam webcam, File file, String format) {
}

public static final void capture(Webcam webcam, String filename) {
if (filename.endsWith(".jpg")) {
if (!filename.endsWith(".jpg")) {
filename = filename + ".jpg";
}
capture(webcam, new File(filename));
}

public static final void capture(Webcam webcam, String filename, String format) {
String ext = "." + format.toLowerCase();
if (!filename.startsWith(ext)) {
if (!filename.endsWith(ext)) {
filename = filename + ext;
}
capture(webcam, new File(filename), format);
Expand Down

0 comments on commit da8468b

Please sign in to comment.