Attempting to set a GPS lat/lon EXIF value to a string (containing fractions) fails

Bug #842754 reported by Hobson Lane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyexiv2
Incomplete
Undecided
Unassigned

Bug Description

pyexiv2.__version__ = '0.3.0', latest revision: Mon 2011-08-22 21:02:12 +0200

Some error message trace output below:
  File "/home/hobs/.local/lib/python2.7/site-packages/pyexiv2/metadata.py", line 271, in __setitem__
    return getattr(self, '_set_%s_tag' % family)(key, tag_or_value)
  File "/home/hobs/.local/lib/python2.7/site-packages/pyexiv2/metadata.py", line 219, in _set_exif_tag
    tag = ExifTag(key, tag_or_value)
  File "/home/hobs/.local/lib/python2.7/site-packages/pyexiv2/exif.py", line 108, in __init__
    self._set_value(value)
  File "/home/hobs/.local/lib/python2.7/site-packages/pyexiv2/exif.py", line 198, in _set_value
    self.raw_value = self._convert_to_string(value)

Suggested patch attached

Revision history for this message
Hobson Lane (hobs) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the report Hobson.
Could you please attach the script that raises this error message that your patch fixes?

Changed in pyexiv2:
status: New → Incomplete
Revision history for this message
Olivier Tilloy (osomon) wrote :

I’m trying to understand the purpose of the patch, and it seems to me that what you want to do is set the value of a tag to a string. If this is the case, the raw_value attribute of ExifTag is what you want to use (see http://tilloy.net/dev/pyexiv2/tutorial.html#reading-and-writing-exif-tags for documentation).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.