Skip to content

Commit

Permalink
don't let debug logging trigger an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rascalking committed Apr 4, 2024
1 parent d60f18d commit d2115a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions exifread/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,14 @@ def process_file(fh: BinaryIO, stop_tag=DEFAULT_STOP_TAG,

endian = chr(ord_(endian[0]))
# deal with the EXIF info we found
logger.debug("Endian format is %s (%s)", endian, {
endian_readable = {
'I': 'Intel',
'M': 'Motorola',
'\x01': 'Adobe Ducky',
'd': 'XMP/Adobe unknown'
}[endian])
}
logger.debug("Endian format is %s (%s)", endian,
endian_readable.get(endian, "Unknown"))

hdr = ExifHeader(fh, endian, offset, fake_exif, strict, debug, details, truncate_tags)
ifd_list = hdr.list_ifd()
Expand Down

0 comments on commit d2115a1

Please sign in to comment.