We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d863b62 commit b5935f0Copy full SHA for b5935f0
exifread/utils.py
@@ -45,7 +45,9 @@ def make_string_uc(seq) -> str:
45
First 8 bytes gives coding system e.g. ASCII vs. JIS vs Unicode.
46
"""
47
if not isinstance(seq, str):
48
- seq = seq[8:]
+ # Remove code from sequence only if it is valid
49
+ if make_string(seq[:8]).upper() in ('ASCII', 'UNICODE', 'JIS', ''):
50
+ seq = seq[8:]
51
# Of course, this is only correct if ASCII, and the standard explicitly
52
# allows JIS and Unicode.
53
return make_string(seq)
0 commit comments