Skip to content

Commit

Permalink
Improve cleanup of undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
EtiennePelletier committed Sep 21, 2024
1 parent 56ff34d commit 0aba46f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion EXIF.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def main(args) -> None:
value = data[field]
try:
if args.builtin_types:
logger.info('%s: %s', field, value)
logger.info('%s (%s): %r', field, type(value).__name__, value)
else:
logger.info('%s (%s): %s', field, FIELD_TYPES[value.field_type][2], value.printable)
except:
Expand Down
4 changes: 2 additions & 2 deletions exifread/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def convert_types(exif_tags: dict) -> dict:

# Undefined
elif code == 'U':
# These contain bytes represented as a list of integers
out = bytes(ifd_tag.values)
# These contain bytes represented as a list of integers, sometimes with surrounding space/null bytes
out = bytes(ifd_tag.values).strip(b' \x00')

# Empty byte sequences or unicode values should be decoded as strings
try:
Expand Down

0 comments on commit 0aba46f

Please sign in to comment.