Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Fixed writing bytes as ASCII tag

Open radarhere opened this issue 3 years ago • 0 comments

Resolves #6492

The issue provides an image where tag 271 has type UNDEFINED. https://www.awaresystems.be/imaging/tiff/tifftags/make.html states tag 271 should have type ASCII. The tag is loaded as bytes then, not a string as expected, and when Pillow tries to encode the string, it fails.

This PR simply changes TiffImagePlugin to not encode if the variable is already bytes.

radarhere avatar Aug 11 '22 10:08 radarhere