I’m using PIL (actually PILLLOW) to try to save some LZW compressed tiff images.
But Im hitting a unicode error when I use Image.save()
>>> from PIL import Image
>>> im=Image.open("test.tif")
>>> im
<PIL.TiffImagePlugin.TiffImageFile image mode=RGB size=2048x2048 at 0x2E0C448>
>>> im.save("test2.tif")
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Python27\lib\site-packages\PIL\Image.py", line 1682, in save
save_handler(self, fp, filename)
File "C:\Python27\lib\site-packages\PIL\TiffImagePlugin.py", line 1204, in _save
offset = ifd.save(fp)
File "C:\Python27\lib\site-packages\PIL\TiffImagePlugin.py", line 531, in save
data = value = b"" + value.encode('ascii', 'replace') + b"\0"
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 25: ordinal not in range(128)
But I have little Experience with PIL…any help?