The sips
command is useful if you want to get the EXIF of an image from the Mac command line
sips -g all *.jpg
You can get the EXIF list of jpg images with. I wrote a script that uses this to rename the image when it was taken.
# -*- coding: utf-8 -*-
import os
import sys
import commands
if __name__ == "__main__":
pics = [pic for pic in os.listdir('.') if pic.startswith('DSCN')]
for pic in pics:
cmd = "sips -g all " + pic + " | grep creation | awk '{print $2,$3}'"
out = commands.getoutput(cmd).split()
dst = out[0].replace(':', '-') + ' ' + out[1].replace(':', '.') + '.jpg'
print '{pic} -> {dst}'.format(pic=pic, dst=dst)
os.rename('./' + pic, './' + dst)
Useful when organizing photos taken with a digital camera.
Recommended Posts