-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
I still have a rotated photo (the same as I reported earlier) and I still want to exif_transpose it: https://cdn.everypony.ru/storage/06/18/58/2019/08/19/3e8e6e42ca.jpg
ImageOps.exif_transpose works great, but I want to keep exif as is (except orientation tag, of course):
from PIL import Image, ImageOps
im = Image.open('3e8e6e42ca.jpg')
im2 = ImageOps.exif_transpose(im)
im2.save('3e8e6e42ca_rotated.jpg', exif=im2.info['exif'])However, I found that some of the tags were gone. It turned out that the exif data is corrupted:
im3 = Image.open('3e8e6e42ca_rotated.jpg')
PIL/TiffImagePlugin.py:793: UserWarning: Corrupt EXIF data. Expecting to read 12 bytes but only got 11. Third-party tools like exiv2 also generate a lot of warnings:
$ exiv2 -u -p e 3e8e6e42ca_rotated.jpg
Error: Directory Photo: IFD entry 47 lies outside of the data buffer.
Warning: Directory Photo, entry 0x0191 has unknown Exif (TIFF) type 1024; setting type size 1.
Error: Offset of directory Photo, entry 0x0191 is out of bounds: Offset = 0x01000302; truncating the entry
Warning: Directory Photo, entry 0x0592 has unknown Exif (TIFF) type 256; setting type size 1.
Error: Directory Photo, entry 0x0592 has invalid size 3187671040*1; skipping entry.
[...]
So I leave this issue here.
If this information matters — Ubuntu 18.04/20.04, Python 3.6/3.8, Pillow 8.1.0