A ValueError is raised when accessing the value of a malformed MakerNote
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyexiv2 |
Fix Committed
|
Medium
|
Unassigned |
Bug Description
There are TODOs in the source code to address this bug and crude work-around patch is provided.
If a tag value contains a single Null byte ( chr(0) ), it is interpreted by pyexiv2 as an "undefined" value, and attempting to read the value for that tag produces the error
ValueError: invalid literal for int() with base 10: ''
when pyexiv2 attempts to convert the string to an integer. This error only occured for a Canon EOS image that was processed by the Windows photo manager and then had its EXIF tags read and re-written by pyexiv2 in Ubuntu. Sample images will be provided in comments to this bug.
known to be present in version 0.3.0 (Ubuntu distribution package) and version 0.3.2 (development) of pyexiv2
Related branches
Changed in pyexiv2: | |
assignee: | Olivier Tilloy (osomon) → nobody |
File "/usr/lib/ python2. 7/dist- packages/ pyexiv2/ exif.py" , line 190, in _get_value _compute_ value() python2. 7/dist- packages/ pyexiv2/ exif.py" , line 185, in _compute_value to_python( self._raw_ value) python2. 7/dist- packages/ pyexiv2/ exif.py" , line 333, in _convert_to_python to_string( value) python2. 7/dist- packages/ pyexiv2/ utils.py" , line 148, in undefined_to_string rstrip( ).split( ' '))) python2. 7/dist- packages/ pyexiv2/ utils.py" , line 148, in <lambda> rstrip( ).split( ' ')))
self.
File "/usr/lib/
self._value = self._convert_
File "/usr/lib/
return undefined_
File "/usr/lib/
return ''.join(map(lambda x: chr(int(x)), undefined.
File "/usr/lib/
return ''.join(map(lambda x: chr(int(x)), undefined.
ValueError: invalid literal for int() with base 10: ''