-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
EXIF prefix saved in WebP #6580
Copy link
Copy link
Closed
Description
What did you do?
I saved 2 copies of a webp file, one with exif=exif_bytes as shown, one without, then added the exif data by piexif.insert
What did you expect to happen?
exif data to be the same
What actually happened?
winmerge binary comparison reveals "Exif" is quoted one extra time in the Pillow image.save version indicating a coding error
What are your OS, Python and Pillow versions?
- OS: Windows 10
- Python: 3.8
- Pillow: 9.2.0
from PIL import Image
import piexif
import piexif.helper
info = "test data in User Comment"
fullfn = "sample_image.webp"
exif_bytes = piexif.dump({
"Exif": {
piexif.ExifIFD.UserComment: piexif.helper.UserComment.dump(info, encoding="unicode")
},
})
with Image.open(fullfn) as image:
image.save(fullfn, quality=60, exif=exif_bytes)
image.save("sample_image_inserted_exif.webp", "webp", quality=60)
piexif.insert(exif_bytes, "sample_image_inserted_exif.webp")Reactions are currently unavailable