We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This also indirectly breaks PIL.ImageOps.exif_transpose().
PIL.Image.open("x.jpg").getexif().tobytes()
The image is attached:
x.jpg
throws:
File .../.venv/lib/python3.10/site-packages/PIL/Image.py:3589, in Exif.tobytes(self, offset) 3587 value[0xA005] = self.get_ifd(0xA005) 3588 ifd[tag] = value -> 3589 return b"Exif\x00\x00" + head + ifd.tobytes(offset) File .../.venv/lib/python3.10/site-packages/PIL/TiffImagePlugin.py:876, in ImageFileDirectory_v2.tobytes(self, offset) 874 else: 875 values = value if isinstance(value, tuple) else (value,) --> 876 data = self._write_dispatch[typ](self, *values) 878 tagname = TiffTags.lookup(tag, self.group).name 879 typname = "ifd" if is_ifd else TYPES.get(typ, "unknown") File .../.venv/lib/python3.10/site-packages/PIL/TiffImagePlugin.py:730, in ImageFileDirectory_v2.write_string(self, value) 727 @_register_writer(2) 728 def write_string(self, value): 729 # remerge of https://github.com/python-pillow/Pillow/pull/1416 --> 730 return b"" + value.encode("ascii", "replace") + b"\0" AttributeError: 'bytes' object has no attribute 'encode'
The text was updated successfully, but these errors were encountered:
https://www.awaresystems.be/imaging/tiff/tifftags/make.html states that tag 271 should have type ASCII, but in the image you've provided, it has the type UNDEFINED. So that is what is unusual about your image.
I've created PR #6493 to resolve this.
Sorry, something went wrong.
Thank you! The image was created in the Android emulator Camera btw. I've not encountered this case somewhere else
Successfully merging a pull request may close this issue.
This also indirectly breaks PIL.ImageOps.exif_transpose().
What did you do?
The image is attached:
x.jpg
What actually happened?
throws:
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: