Skip to content

Commit

Permalink
Properly handle imgfolder parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mvmn committed Apr 7, 2017
1 parent f518e2d commit 85f11dc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/main/java/x/mvmn/gp2srv/GPhoto2Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public GPhoto2Server(String contextPath, Integer port, final LogLevel logLevel,
imageDldPath = new File(userHome, "gp2srv_images").getAbsolutePath();
}
File imageDldFolder = new File(imageDldPath);
System.out.println("Images download folder: " + imageDldFolder.getCanonicalPath());
if (!imageDldFolder.exists()) {
imageDldFolder.mkdirs();
} else if (!imageDldFolder.isDirectory()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/x/mvmn/gp2srv/GPhoto2ServerLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void main(String[] args) throws Exception {
cliOptions.addOption("gphoto2path", true, "Path to gphoto2 executable.");
cliOptions.addOption("logLevel", true, "Log level (TRACE, DEBUG, INFO, WARN, ERROR, SEVERE, FATAL).");
cliOptions.addOption("auth", true, "Require authentication (login:password).");
cliOptions.addOption("imgfolder", false, "Path to store downloaded images at.");
cliOptions.addOption("imgfolder", true, "Path to store downloaded images at.");

String imageDldPath = null;
final CommandLine commandLine = new PosixParser().parse(cliOptions, args);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/x/mvmn/util/ImageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ public static int argbToBlue(int argb) {
/*
* public static double calculateAverageBrightnessSlowReliable(BufferedImage image) { long result = 0;
*
* // TODO: parallelize
*
* int argbs[] = image.getRGB(0, 0, image.getWidth(), image.getHeight(), new int[image.getWidth() * image.getHeight()], 0, image.getWidth()); for (int i =
* 0; i < argbs.length; i++) { int argb = argbs[i]; result += argbToRed(argb); result += argbToGreen(argb); result += argbToBlue(argb); }
*
Expand Down

0 comments on commit 85f11dc

Please sign in to comment.