Put Image Size Into Filename

Sometimes it is useful to have image size written in filename (I needed it when I was browsing my collection of wallpapers). I could not find any tool which would automate this process, so I have decided to write one. Probably it is job for bash or Python but I like Java most, so it is Java CLI tool. I have used ImageInfo class to get image parameters.

That’s what it does:

scans all parameters for options – there is only one valid option: -p which switches the tool from the dry mode (tool only shows what should be done) to the working mode

for every non-option parameter:

check if it is path to an image

read image width and height from the file

check if the file name already contains valid info about the image size