Does pyexiv2 support writing XMP tags to GIFs?

Asked by Erik Ritschl on 2015-08-30

I tried adding an XMP tag to a gif, but I received the following error:

Traceback (most recent call last):
  File "", line 19, in <module>
  File "/usr/lib/python2.7/dist-packages/pyexiv2/", line 119, in write
IOError: Writing to GIF images is not supported

This is my code:

# -*- coding: utf-8 -*-

import os
import pyexiv2

metadata = pyexiv2.ImageMetadata("smug.gif")

key = "Xmp.xmp.Keywords"
values = "gif"
metadata[key] = pyexiv2.XmpTag(key, values)

tag = metadata[key]

Does pyexiv2 really not support writing XMP tags to GIFs, even though GIFs support XMP? Or do I have some kind of error in my code?

I know pyexiv2 is techniacally deprecated in favor of gexiv2, but I get the same error with it. I also don't know how I would package gexiv2 for a windows installation. I'm developing on Linux, but I want my application to be cross platform. I also tried the python XMP toolkit, but that doesn't work on Windoes either.

If exiv2 really doesn't support GIFs, is there any python library that does, and works cross platform?

Question information

English Edit question
pyexiv2 Edit question
No assignee Edit question
Last query:
Last reply:
Olivier Tilloy (osomon) said : #1

Both pyexiv2 and gexiv2 are based on libexiv2.

If it doesn’t support writing XMP tags to GIFs, and you think it should, it is worth a bug report (or question) at

I’m not aware of other python libraries that would support that.

Can you help with this problem?

Provide an answer of your own, or ask Erik Ritschl for more information if necessary.

To post a message you must log in.