Published: February 4, 2018
by Tobias Pleyer
Tags: python

Renaming annoying generic picture names

A really quick and dirty script to rename pictures with a generic filename to have more meaningful names. One especially annoying thing is when the pictures have the camera’s picture count in them, e.g. CAM_2345.jpg.

The script will search for pictures meeting a glob pattern, e.g. CAM_*, and rename all of these files given the new basename and a meaningful counter, starting at 1 and padded with zeros, i.e. “001” instead of just 1.

The script isn’t very user friendly or error proof etc., but it does the job, uses Python’s new pathlib library and was hacked in under 10 minutes.