Bug 483288 - xmp metadata of some jxl files are not correctly displayed (missing data, duplicated strings, ...)
Summary: xmp metadata of some jxl files are not correctly displayed (missing data, dup...
Status: RESOLVED NOT A BUG
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Xmp (show other bugs)
Version: 8.3.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-11 20:19 UTC by mahikeulbody
Modified: 2024-03-12 06:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 8.3.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mahikeulbody 2024-03-11 20:19:44 UTC
SUMMARY
XMP metadata of the attached jxl file is correctly displayed with exiftool command line but not within the XMP Metadata Panel neither into Title panel neither into Exiftool Panel.

STEPS TO REPRODUCE
1. exiftool -xmp:all -G1 <attached file>    # version 12.56, the same as digikam
2. import <attached file> into digikam
3. check metadata/xmp panel, metadata/exiftool/xmp part panel, caption/title panel

OBSERVED RESULT
metadata/xmp panel displays only dc.subject
metadata/exiftool/xmp part panel : the string of many fields is duplicated 4 ou 5 times (for example, country code "FRA, FRA, FRA, FRA")
caption/title panel : it is empty instead to display "randonnée en Chartreuse ..."

Report made with digiKam-8.3.0-20240310T140351-x86-64.appimage (2024-03-10 14:18).
Comment 1 mahikeulbody 2024-03-11 20:22:42 UTC
I cannot attach the file (> 4Mo) so here a link : https://drive.google.com/file/d/1ArGRHVMY9esb6Rnaz_qqaNPp-nodP0Q2/view?usp=sharing
Comment 2 Maik Qualmann 2024-03-11 21:00:45 UTC
The XMP metadata in your image is broken or exists multiple times.
This is the XML block that Exiv2 only finds:

<?xml version="1.0"?>
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
      <dc:subject>
        <rdf:Bag>
          <rdf:li>Test</rdf:li>
        </rdf:Bag>
      </dc:subject>
    </rdf:Description>
  </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>

ExifTool is a little more efficient in its search and also finds the next block and more. We use this ExifTool to capture all metadata:

exiftool -json -xmp:all -G:0:1:2:4:6 -l 2023-08-13_10h34-47.jxl

As you can see in the JSON output, e.g. "FRA" there are multiple copies. We merge these with a comma for viewing in digiKam.
If you view the file with a hex editor, you will also see that XMP-XML blocks exist multiple times. We can't help here.

Maik
Comment 3 Maik Qualmann 2024-03-11 21:14:32 UTC
The duplicate XMP-XML blocks were written with ExifTool 12.56. These errors can be found corrected in the history of version 12.57:

Feb. 23, 2023 - Version 12.57
Fixed bug where a duplicate XMP could be generated when writing XMP to a JPEG XL image which already contained XMP

So it was a bug in ExifTool, I'm closing here now.

Maik
Comment 4 Maik Qualmann 2024-03-11 21:22:42 UTC
You can repair the image with the following command:

exiftool -xmp:all= -TagsFromFile @ -xmp:all 2023-08-13_10h34-47.jxl

Maik
Comment 5 mahikeulbody 2024-03-12 06:21:44 UTC
Indeed, I was using an old version of exiftool despite my manjaro is normally up to date (but warning an old exiftool library, may be resulting from an old manual installation ???). The problem remained even de-installing and then re-installing exiftool. So I removed manually all exiftool files I found and then I re-installed it (12.76). Now I have no more the bug.

(I found this problem when I ran my script to remove the "places" tags from dc.subject tag. It worked well... except on jxl files because the old exiftool library version.)

Thank you very much for taking the time to analyze the problem even after to check the file was broken.