I changed my FocalApp java application a little bit. First, there was sometimes a memory exception as the old version did a “new File()” in each loop iteration and apparently the garbage collector couldn’t catch up. I moved the file-open operation into an own class method and now the GC seems to get its job done. Second, I added some more command line parameters for specifying the camera model, the file extensions and the file name pattern – which all filter the resulting image file list used for the focal length count. Hence one can now say “Only count the images whose EXIF data’s camera model is a Canon 300D, but only the CRW files and only the files starting with CRW_50”. In addition I added a little help screen:
Build: javac -Xlint:unchecked -classpath .;metadata-extractor-2.4.0-beta-1.jar FocalApp.java jar cfm FocalApp.jar Manifest.txt *.class Usage: java -jar FocalApp.jar [Options] Description: For all images in the given directory and its subdirectories read the lenses' focal length from the exif data and print a summary of how often the particular focal lengths are used. Currently this program works with the following image types: * JPEG * CRW - Canon Raw * CR2 - Canon Raw v2 * NEF - Nikon Raw * ARW - Sony Raw * TIF/TIFF Options: -imagepath path for the images to work on (required) -camera string with the name of the camera, the program will (optional) only count the images containing that camera name -fileext only count images with that file extension(s) (optional) -filename only count images matching this regular expression (optional) Examples: java -jar FocalApp.jar -imagedir "D:testimages" java -jar FocalApp.jar -imagedir "D:testimages" -camera "Canon EOS 30D" -fileext "jpg,crw" -filename "^CRW(.*)"