Skip to content

Write xmp data? #7543

Answered by radarhere
PescheHelfer asked this question in Q&A
Discussion options

You must be logged in to vote

Pillow doesn't currently support saving XMP, no, with one exception - you can save the XMP data for WebP from a string.

from PIL import Image
im = Image.open("Tests/images/flower2.webp")
xmp = im.getxmp()
print(len(str(xmp)))

im.save("out.webp", xmp=im.info["xmp"])
reloaded = Image.open("out.webp")
print(len(str(reloaded.getxmp())))

So what image format are you using?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by PescheHelfer
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants