#1430·immich-go

XMP sidecars: a tag list with several items is ignored, and a sidecar with a single rdf:Description yields nothing but GPS

Author: gthbCreated Aug 22, 2026Updated Aug 22, 2026

Summary

Layouts of .xmp sidecar that immich-go reads wrongly (v0.32.0, internal/exif/sidecars/xmpsidecar/read.go):

  • a digiKam:TagsList with more than one rdf:li: none of the tags is applied (a list with a single item works);
  • a description repeated in several languages (an rdf:Alt with more than one rdf:li): the description is dropped;
  • all properties in one rdf:Description element: nothing is read except the GPS coordinates; description, date, rating and tags are dropped.

Cause

The reader walks the parsed document and matches property paths such as TagsList/Seq/li. walk appends an index to the elements of a list (Description[2], li[1]), and filter strips only the index of the Description element:

  • with several rdf:li, each item's path gets a li[N] segment and matches nothing;
  • with a single rdf:Description there is no index, the prefix /xmpmeta/RDF/Description/ is never stripped, and the properties' paths match nothing; the GPS cases are written for exactly that unindexed form, which is why they are the only ones that work in this layout (and they never match in the multi-Description layout).

walk also reassigns its path variable when it meets a list, so the keys that follow the list in the same element are looked up under a wrong prefix.

Reproduction

Two of the sidecars added as test data in the PR (excerpted):

xml
<!-- multi-tags.jpg.xmp: three tags, several rdf:Description elements -->
<rdf:Description xmlns:digiKam='http://www.digikam.org/ns/1.0/'>
  <digiKam:TagsList><rdf:Seq><rdf:li>ari</rdf:li><rdf:li>baldur</rdf:li><rdf:li>people/jakob</rdf:li></rdf:Seq></digiKam:TagsList>
</rdf:Description>
xml
<!-- single-description.jpg.xmp: everything in one rdf:Description -->
<rdf:Description rdf:about='' xmlns:tiff='…' xmlns:digiKam='…' xmlns:exif='…' xmlns:xmp='…'>
  <tiff:ImageDescription><rdf:Alt><rdf:li xml:lang='x-default'>All in one</rdf:li></rdf:Alt></tiff:ImageDescription>
  <digiKam:TagsList><rdf:Seq><rdf:li>solo</rdf:li></rdf:Seq></digiKam:TagsList>
  <exif:DateTimeOriginal>2020-02-02T10:20:30Z</exif:DateTimeOriginal>
  <exif:GPSLatitude>48,24.50256879N</exif:GPSLatitude>
  <exif:GPSLongitude>3,5.43538761W</exif:GPSLongitude>
  <xmp:Rating>3</xmp:Rating>
</rdf:Description>

ReadXMP reads no tags from the first (expected 3 tags, got 0), and from the second only the latitude and longitude: description, date, rating and tags all stay at their zero values.

Seen in practice with upload from-folder on a tree with 1,918 generated sidecars: files with one keyword were tagged, files with two or more got no tags at all (e.g. a keyword present in 711 sidecars was applied to 453 assets, only where it was the single item).

Fix

PR #1431: strip every list index and the /xmpmeta/RDF/Description/ prefix before matching, match GPS on the normalised path like the other properties, take the first entry of a multi-language description (the XMP specification puts x-default first), and keep walk's path local.