Does pyexiv2 support writing XMP tags to GIFs?

Asked by Erik Ritschl

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

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

This is my code:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import pyexiv2

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

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

tag = metadata[key]
metadata.write()

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

Language:
English Edit question
Status:
Answered
For:
pyexiv2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
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 http://dev.exiv2.org/projects/exiv2/issues.

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.