LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
202 stars 39 forks source link

XMP Toolkit error 201: Error in XMLValidator #114

Closed Ares-cz closed 1 year ago

Ares-cz commented 1 year ago

when using macOS with Intel chip to test pyexiv2

img = pyexiv2.Image('./test_image/MS600_0007_450nm.tif') data = img.read_xmp()

print(data) img.close()

while it has an error:

RuntimeError: XMP Toolkit error 201: Error in XMLValidator

LeoHsiao1 commented 1 year ago

This seems to be a resolved issue of exiv2. https://github.com/Exiv2/exiv2/pull/2133 I would upgrade the version of exiv2 that pyexiv2 depends on to fix the issue. Alternatively, you can use the method img.read_raw_xmp().

Ares-cz commented 1 year ago

I have tried your method, but it doesn't work.

I look forward your upgrade on this issue.

Ares-cz commented 1 year ago

import pyexiv2

img = pyexiv2.Image('./test_image/MS600_0007_450nm.tif') data = img.read_raw_xmp() print(data)

img.close()

The error shows on the img = pyexiv2.Image('./test_image/MS600_0007_450nm.tif')

LeoHsiao1 commented 1 year ago

I just released v2.8.2, please try it! pip install pyexiv2==2.8.2

Ares-cz commented 1 year ago

image it still have the same problem. i am not sure if the problem on my image because i try another image, it could be worked.

LeoHsiao1 commented 1 year ago

This is probably because the xmp metadata for this image is not standardized. Please try exiv2 to see if it can read the xmp metadata for that image.

  1. Download exiv2 from https://exiv2.org/download.html
  2. execute the command exiv2 --print x MS600_0007_450nm.tif