Skip to content

Instantly share code, notes, and snippets.

@arvi1000
Last active May 23, 2022 20:24
Show Gist options
  • Save arvi1000/dcc09d39a237d20f283f5ba8cdd11aa5 to your computer and use it in GitHub Desktop.
Save arvi1000/dcc09d39a237d20f283f5ba8cdd11aa5 to your computer and use it in GitHub Desktop.
# Process all JPEG files in the current dir and apply timestamp, using imagemagick
import glob
import re
import os
jpgs = glob.glob('*.jpeg')
for j in jpgs:
newfile = re.sub('\\.jpeg$', '_stamp.jpeg', j)
im_command = f'convert {j} -undercolor Black -fill white -pointsize 100 -auto-orient -gravity NorthWest -annotate 0 "%[EXIF:DateTimeOriginal]" {newfile}'
print(f'Processing {j}')
os.system(im_command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment