peircej / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

Cannot set original date prior to 1900 #133

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Change absolute date on an image to a value prior to 1900

What is the expected output? What do you see instead?
I expected a date prior to 1900
I got:
Traceback (most recent call last):
   File "jbrout.py", line 1951, in on_selecteur_menu_select_plugin
    ret=callback(l)
   File "/home/steve/downloads/SVNjBrout/plugins/__init__.py", line 270, in
myCallBack
    ret=callback(*a,**k)
   File "/home/steve/downloads/SVNjBrout/plugins/redate/__init__.py", line
50, in redate
    i.setDate(value)
   File "/home/steve/downloads/SVNjBrout/jbrout/db.py", line 821, in setDate
    pc.setDate(date)
   File "/home/steve/downloads/SVNjBrout/jbrout/tools.py", line 390, in setDate
    self.__info["Exif.Image.DateTime"]=fd
   File "/usr/lib/pymodules/python2.5/pyexiv2.py", line 593, in __setitem__
    typeName = self.__setExifTagValue(key, value)
   File "/usr/lib/pymodules/python2.5/pyexiv2.py", line 442, in
__setExifTagValue
    strVal = value.strftime('%Y:%m:%d %H:%M:%S')
 ValueError: year=1896 is before 1900; the datetime strftime() methods
require year >= 1900

What version of the product are you using? On what operating system?

Debian, using svn trunk (rev. 275)

Please provide any additional information below.

I have previously successfully used exiftool to alter an image Date/Time to
1878, the error seems like a python limitation?

steve@missus:~/Photos/2008/11/05$ exiftool slide002.tif | grep Date

File Modification Date/Time     : 2009:11:09 21:31:37+11:00
Date/Time Original              : 1878:00:00 06:49:00
Profile Date Time               : 1998:02:09 06:49:00

Original issue reported on code.google.com by stephen....@gmail.com on 18 Nov 2009 at 10:52

GoogleCodeExporter commented 8 years ago
cant reproduce that !

feel free to repoen if needed
I close it

Original comment by manat...@gmail.com on 14 Oct 2010 at 9:33