Skip to content

Commit

Permalink
Merge pull request #330 from fcestrada/master
Browse files Browse the repository at this point in the history
Fix extension name image file.
  • Loading branch information
sarxos committed Apr 11, 2015
2 parents 0d41c59 + da8468b commit e2914f9
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 e2914f9

Please sign in to comment.