Skip to content

EXIF prefix saved in WebP #6580

@jjisnow

Description

@jjisnow

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions