picseal_pub/exif_w.py

27 lines
703 B
Python
Executable File

#!/usr/bin/python3
from gi.repository import GExiv2
exif = GExiv2.Metadata('rims.jpg')
print("*** *** *** *** *** *** ***")
print(exif)
print(exif.get_date_time())
print ("*** *** *** *** *** *** ***")
# longitude, latitude, altitude
#exif.set_gps_info(-79.3969702721, 43.6295057244, 76)
# Using dict notation like this reads/writes RAW string values
# into the EXIF data, with no modification/interpolation by GExiv2.
# Refer to GExiv2.py to see what kind of convenience methods are
# supplied for setting/getting non-string values.
#IPTC = 'Iptc.Application2.'
#exif[IPTC + 'City'] = 'Toronto'
#exif[IPTC + 'ProvinceState'] = 'Ontario'
#exif[IPTC + 'CountryName'] = 'Canada'
#exif.save_file()