Wednesday, August 7, 2013

Recursively resize images

A couple of days ago I was trying to share my photos to my relatives. The thing is that there was 25Gb of photos and there was a bunch of nested folders in my photo collection. I didn't want to share the photos in such a high resolution and that was a problem #1. Admittedly I did have a image converter that could be used as image resizer but it only worked with one folder, completely ignoring the nested, so there was a problem #2.

I decided to create a simple image resizer that could recursively traverse through nested folders and resize the images. As usual, sources and binary (github). Note that You need JRE to run the recursive image resizer.

I should say I find that utility pretty useful (at least for me :)
  1. The first good thing is that you invoke it with SOURCE_DIR and DESTINATION_DIR parameters and it creates 100% identical copy of SOURCE_DIR, resizes the images and places them in the same place (ralative to source dir). 
  2. The second good thing is that it utilizes mutiple CPU's of your machine, so, hopefully it the recursive conversion of your images should complete faster. 

The usage of  recursive image resizer is simple, just run to get help:
java -Xmx1024m -jar image-resize-app.jar

I'll give you a simple example:
java -Xmx1024m -jar image-resize-app.jar -r 1920,1440 /home/username/photos /home/username/photos_resized

No comments:

Post a Comment