Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #5555

In TiffImagePlugin, values might not be defined when it is comes to be used in logging.

if is_ifd:
    ...
else:
    values = value if isinstance(value, tuple) else (value,)
    ...

...
msg += " - value: " + (
    "<table: %d bytes>" % len(data) if len(data) >= 16 else str(values)
)

This PR fixes it by ensuring that values is always defined.

@radarhere radarhere added the Bug Any unexpected behavior, until confirmed feature. label Jun 25, 2021
@hugovk hugovk merged commit 52856bc into python-pillow:master Jun 26, 2021
@radarhere radarhere deleted the empty_subifd branch June 26, 2021 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Any unexpected behavior, until confirmed feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"UnboundLocalError: local variable 'values' referenced before assignment" when image.getexif().tobytes() on specific JPEGs

2 participants