mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-16 02:04:45 +03:00
Correct ValueError
When when info.length is 1 and len(values) >1, the code used to throw: ValueError: too many values to unpack (expected 1) For example: tag IMAGEJ_META_DATA_BYTE_COUNTS (50838) can sometimes have two values (I have .tif files with metadata split between UTF8 and UTF16 => one byte count for each)
This commit is contained in:
parent
2023c7cea1
commit
45f65846db
|
@ -550,7 +550,7 @@ class ImageFileDirectory_v2(collections.MutableMapping):
|
|||
|
||||
dest = self._tags_v1 if legacy_api else self._tags_v2
|
||||
|
||||
if info.length == 1:
|
||||
if info.length > 0 and len(values) == 1:
|
||||
if legacy_api and self.tagtype[tag] in [5, 10]:
|
||||
values = values,
|
||||
dest[tag], = values
|
||||
|
|
Loading…
Reference in New Issue
Block a user