Cached metadata is not converted to its correct type

Bug #183332 reported by Olivier Tilloy
4
Affects Status Importance Assigned to Milestone
pyexiv2
Fix Released
Low
Olivier Tilloy

Bug Description

pyexiv2's internally cached metadata is not converted into the correct type although the data effectively written to the file is.
Here is an example interactive python session to reproduce:

------------
In [1]: import pyexiv2
In [2]: a = pyexiv2.Image('test.jpg')
In [3]: a.readMetadata()
In [4]: a['Iptc.Application2.Keywords']
Out[4]: ('3', '4')
In [5]: a['Iptc.Application2.Keywords'] = (5, 6)
In [6]: a.writeMetadata()
In [7]: a.readMetadata()
In [8]: a['Iptc.Application2.Keywords']
Out[8]: (5, 6)
In [9]:
Do you really want to exit ([y]/n)?

someone@somewhere:~/exif$ ipython
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
[...]

In [1]: import pyexiv2
In [2]: a = pyexiv2.Image('test.jpg')
In [3]: a.readMetadata()
In [4]: a['Iptc.Application2.Keywords']
Out[4]: ('5', '6')
------------

Here the new multiple values of tag 'Iptc.Application2.Keywords' are correctly written as strings ('5', '6') but the internal cache, after setting them, holds them as integers (5, 6) as passed to the setter.

Olivier Tilloy (osomon)
Changed in pyexiv2:
assignee: nobody → osomon
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

Fix committed with revision 95.
The new value is now converted before being written to the internal metadata cache.
A unit test has been added to validate the fix.

Changed in pyexiv2:
status: Confirmed → Fix Committed
Tom Haddon (mthaddon)
description: updated
Olivier Tilloy (osomon)
Changed in pyexiv2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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