Not parsing icloudpd xmp files
Describe the bug
Thanks a lot for the tool.
icloud_photos_downloader generates an xmp from Apple metadata since v1.25.0 (https://github.com/icloud-photos-downloader/icloud_photos_downloader/releases/tag/v1.25.0) but those are not read by exiv2 even if valid image file (read by digikam, feh, browsers...). This prevents import of those metadata in digikam for example.
To Reproduce
$ more /media/path/to/IMG_1029.JPG.xmp
<?xml version='1.0' encoding='utf-8'?>
<x:xml_doc xmlns:x="adobe:ns:meta/" x:xmptk="icloudpd 1.27.1+27ee59c"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:exif="ht
tp://ns.adobe.com/exif/1.0/"><exif:GPSAltitude>641.1731565865783</exif:GPSAltitude><exif:GPSLatitude>60.731941666666664</exif:GPSLatitude><exif:GPSLongitude>-135.06683333333334</e
xif:GPSLongitude><exif:GPSTimeStamp>2024-01-23T01:12:34</exif:GPSTimeStamp></rdf:Description><rdf:Description rdf:about="" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"><ph
otoshop:DateCreated>2024-01-23T18:12:34-0700</photoshop:DateCreated></rdf:Description><rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/"><xmp:CreateDate>2024-0
1-23T18:12:34-0700</xmp:CreateDate><xmp:Rating>5</xmp:Rating></rdf:Description></rdf:RDF></x:xml_doc>
$ exiv2 -pevv /media/path/to/IMG_1029.JPG.xmp
Exiv2 exception in print action for file /media/path/to/IMG_1029.JPG.xmp:
/media/path/to/IMG_1029.JPG.xmp: The file contains data of an unknown image type
$ exiftool -validate -warning /media/path/to/IMG_1029.JPG.xmp
Validate : 2 Warnings (all minor)
Warning : [minor] Invalid date/time format for XMP:DateCreated
$ exiv2 -pe /media/path/to/IMG_1029.JPG
Exif.Image.Make Ascii 6 Apple
Exif.Image.Model Ascii 10 iPhone
Exif.Image.Orientation Short 1 1
Exif.Image.XResolution Rational 1 72/1
[ok...]
Tested with exiv2 0.28.5 and exiftool 13.10
Expected behavior
metadata should be read correctly and imported when apply
Desktop (please complete the following information):
- OS and version: Linux Fedora 41
- Exiv2 version and source: 0.28.5 from Fedora package
ExifTool is currently not a good validator of XMP, but if you try to write it with ExifTool you will get this:
Error: [minor] Improperly enclosed XMP property: x:xml_doc/rdf:RDF/rdf:Description/xmp:Rating
There are a number of problems with this XMP that are causing this error.
- Phil
Thanks @boardhead How to fix those problems so metadata can be imported either in photo tool or in image itself?