18 lines
431 B
Python
Executable file
18 lines
431 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
import os
|
|
import piexif
|
|
|
|
assert len(sys.argv) >= 3, "Usage {} CREATOR FILENAMES...".format(sys.argv[0])
|
|
creator = sys.argv[1]
|
|
filenames = sys.argv[2:]
|
|
|
|
for filename in filenames:
|
|
assert os.path.isfile(filename)
|
|
exifDict = piexif.load(filename)
|
|
exifDict['0th'][piexif.ImageIFD.Copyright] = creator.encode()
|
|
exifBytes = piexif.dump(exifDict)
|
|
piexif.insert(exifBytes, filename)
|
|
|