Skip to content

Commit 8f6efb2

Browse files
committed
minor updates so tests pass
1 parent ceed353 commit 8f6efb2

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

exifread/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ def process_file(
8585
hdr = ExifHeader(
8686
fh, endian_str, offset, fake_exif, strict, debug, details, truncate_tags
8787
)
88-
ifd_list = hdr.list_ifd()
8988
thumb_ifd = 0
9089
ctr = 0
91-
for ifd in ifd_list:
90+
for ifd in hdr.list_ifd():
9291
if ctr == 0:
9392
ifd_name = "Image"
9493
elif ctr == 1:
@@ -120,11 +119,11 @@ def process_file(
120119
if details and "EXIF MakerNote" in hdr.tags and "Image Make" in hdr.tags:
121120
try:
122121
hdr.decode_maker_note()
123-
except ValueError as e:
122+
except ValueError as err:
124123
if not strict:
125-
logger.debug("Failed to decode EXIF MakerNote")
124+
logger.debug("Failed to decode EXIF MakerNote: %s", str(err))
126125
else:
127-
raise e
126+
raise err
128127

129128
# extract thumbnails
130129
if thumb_ifd and extract_thumbnail:

exifread/core/exif_header.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def _process_field(
194194
offset = offset + type_length
195195
return values
196196

197-
def _process_ascii_field(self, ifd_name, tag_name, count: int, offset: int):
197+
def _process_ascii_field(
198+
self, ifd_name: str, tag_name: str, count: int, offset: int
199+
):
198200
values: Union[str, bytes] = ""
199201
# special case: null-terminated ASCII string
200202
# XXX investigate
@@ -285,8 +287,8 @@ def _process_tag(
285287
entry: int,
286288
tag: int,
287289
tag_name: str,
288-
relative,
289-
stop_tag,
290+
relative: bool,
291+
stop_tag: str,
290292
) -> None:
291293
field_type_id = self.s2n(entry + 2, 2)
292294
try:

0 commit comments

Comments
 (0)