Skip to content

Fix for UnicodeDecodeError: ascii codec cannot decode byte while saving a TIFF image#1309

Closed
bogdan199 wants to merge 2 commits intopython-pillow:masterfrom
bogdan199:tiff_metadata_encoding_fix
Closed

Fix for UnicodeDecodeError: ascii codec cannot decode byte while saving a TIFF image#1309
bogdan199 wants to merge 2 commits intopython-pillow:masterfrom
bogdan199:tiff_metadata_encoding_fix

Conversation

@bogdan199
Copy link
Contributor

Problem occured while saving TIFF images that contain non-ascii characters in metadata.

Solves issue #272

…ng a TIFF image

Problem occured while saving TIFF images that contain non-ascii characters in metadata
@aclark4life
Copy link
Member

screenshot 2015-07-02 05 23 55

@wiredfool
Copy link
Member

IIRC from the tiff spec, the metadata needs to be ascii values < 127. Arguably, erroring is the right thing, esp if we have an explanation handy so that the user can do reasonable substitutions, rather than just dropping the character.

@mkubala
Copy link

mkubala commented Jul 4, 2015

@wiredfool you're right, usually approach of 'explicitly signaled failure' is the right behaviour, except the case of batch processing when you have a lot of (not even dozens but thousands and more) TIFF images with broken metadata encoding. Fix submitted by @bogdan199 makes hard failures recoverable, I like it!

Resolved conflict in PIL/TiffImagePlugin.py
@bogdan199
Copy link
Contributor Author

I've just resolved all conflicts.
Looking forward for a review.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"excersized" isn't a word in US or UK English.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the conflict was resolved the wrong way, reversing the effect of PR #1311

@wiredfool
Copy link
Member

See #1416

@wiredfool wiredfool closed this Sep 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants