pyexiv2-developers team mailing list archive
-
pyexiv2-developers team
-
Mailing list archive
-
Message #00111
Re: Writing XMP Bag and contained information - MS Photo schema - ValueError: Value not set
Hi,
there was a bug in exiv2 which produced wrong XmpType in my scenario.
There is a fix online. I now can set my xmp data using the exiv2 CLI
(revision 2644 plus patch of issue http://dev.exiv2.org/issues/798). See
http://dev.exiv2.org/boards/3/topics/1039#message-1060
But now I encounter a problem with pyexiv2. I am not able to set up an
empty Bag (no value), that contains structs.
exiv2 CLI:
exiv2 -M"set Xmp.MP.RegionInfo/MPRI:Regions ''" BabyGnuTux-Big.jpg
exiv2 -M"set Xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:Rectangle 0.11,
0.22, 0.33, 0.44" BabyGnuTux-Big.jpg
exiv2 -M"set Xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:PersonDisplayName
Baby Gnu" BabyGnuTux-Big.jpg
If I try this with pyexiv2,
import pyexiv2
md = pyexiv2.ImageMetadata('BabyGnuTux-Big.jpg')
md.read()
md['Xmp.MP.RegionInfo/MPRI:Regions'] = ['']
md['Xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:Rectangle'] = '0.11, 0.22,
0.33, 0.44'
md['Xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:PersonDisplayName'] =
'Baby Gnu'
md.write()
I get a ValueError caused by line 4.
Traceback (most recent call last):
File "md_examples.py", line 7, in <module>
md.write()
File "/usr/lib64/python2.7/site-packages/pyexiv2/metadata.py", line
119, in write
self._image._writeMetadata()
ValueError: Value not set
Regards,
Benjamin
References