accessing 'Iptc.Application2.DateCreated' causes TypeError: object of type 'datetime.date' has no len()
I have the following code below:
#------
import pyexiv2
def update_
"""
This takes an image and updates the iptc information based on the passed parameters
"""
if not os.path.
raise Exception, '%s does not exist!' % path
image = pyexiv2.Image(path)
image.
if 'exifDateTime' in iptc:
#storedDate = image['
if 'photographer' in iptc:
if 'copyright' in iptc:
image.
#---------
If I run it as is I get the following error:
Traceback (most recent call last):
File "./camera_
status = main()
File "./camera_
copyright=
File "./camera_
image[
File "/usr/lib/
for i in xrange(
TypeError: object of type 'datetime.date' has no len()
If I uncomment the line:
#storedDate = image['
It works fine. I would like to know what is going on? Is this how I am supposed to set the IPTC date created field? Do I have to access the tag first before I can write a value to it?
Cheers,
Troy
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- pyexiv2 Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- fenris
- Solved:
- Last query:
- Last reply: