Comment 2 for bug 781464

Revision history for this message
Olivier Tilloy (osomon) wrote : Re: Malformed exif tags cause ValueError on Ubuntu Natty Narwhal

A ValueError raised in that case is intended, because the conversion fails.

The real issue is the root cause of this failure: the faulty tag is 'Exif.Pentax.PreviewResolution', and pyexiv2 thinks its type is 'Undefined', as advertised by the documentation (see http://exiv2.org/tags-pentax.html), where in fact it should be 'Short'.
It seems that exiv2 itself knows how to fix the type, because the command line tool returns the correct type:

$ exiv2 -PEkyvt IMGP1118sm.JPG | grep PreviewResolution
Exif.Pentax.PreviewResolution Short 640 480 640x480

This may very well be an issue with the way pyexiv2 queries libexiv2 for the type of a tag.