Recursively clone and resize pictures
Jul 1, 2012, tags: pythonThere are pictures since 2003 on my harddrives which are mirrored occasionally to my HTPC. Most of those pictures are in fairly high resolution which takes a second or two to decode on the HTPC with an Atom cpu. Generally, there isn’t much of a point to view 10 megapixel pictures on a computer screen. Smaller pictures load much quicker.
XBMC has great photo viewing capabilities when connected to a projector and remote, and so I wanted to mirror my large tree of photographs into another tree with rescaled photos to fit my 720p projector to make browsing among them faster.
Python is simply a great tool for these things, os.path.walk recursively finds all files and each file is then rescaled with Imagemagick’s convert, but only if the re-scaled version doesn’t already exist.
Source code on github.