Checks image files for their sizes in a given folder (and its subfolders) and moves the matching images to a temporary folder.
Author: Mario Cuba <[email protected]>
License: Released to the Public Domain under the Creative Commons Attribution 3.0 Unported License.
- Python 2.7.2 (tested, may work with other versions)
- Python Imaging Library (PIL)
Just run python img.py <directory>
and the script will take care of the rest. Once the script is running, define the minimum width (in pixels) that the script will search for.
Image files with a width lower than the defined will be moved to a temporary folder inside so you can process those files later.
This script has been tested in Mac OS X 10.6.8, and it should work in other Unix-like systems.
The script is not desctructive, but if you execute the script in a root folder with a lot of subfolders, you might have a hard time moving them back to where they were. It is reccommended to make a copy in an isolated folder then process the files. If you're satisfied with the result, replace the original folder.
- Add option to recurse through directories, or just process the root directory
- Add option to choose the temporary folder name
- Add option to check for height, or both
- Add Windows support
- Add confirmation of moved files.
- Add logging.