Note that the raw_value attribute of the tag (m['Exif.Photo.MakerNote']) is an empty string, and this is what causes the ValueError to be raised: utils.undefined_to_string(…) expects its parameter to contain the ascii codes of a sequence of bytes, separated by white spaces (e.g. "48 50 50 49").
It would be relatively easy to patch utils.undefined_to_string(…) to check for an empty string and return an empty string in that case.
Hobson, wouldn’t that be enough to fix the bug? As I understand it, your patch tries to address a more general problem. I’d rather fix this specific one, and then address other issues separately, testing against actual images that exhibit the problem and writing unit tests to ensure no regressions.
Note that the raw_value attribute of the tag (m['Exif. Photo.MakerNote ']) is an empty string, and this is what causes the ValueError to be raised: utils.undefined _to_string( …) expects its parameter to contain the ascii codes of a sequence of bytes, separated by white spaces (e.g. "48 50 50 49").
It would be relatively easy to patch utils.undefined _to_string( …) to check for an empty string and return an empty string in that case.
Hobson, wouldn’t that be enough to fix the bug? As I understand it, your patch tries to address a more general problem. I’d rather fix this specific one, and then address other issues separately, testing against actual images that exhibit the problem and writing unit tests to ensure no regressions.