Bug 481762 - Can't write XMP tags: to file Unknown namespace prefix for qualified name
Summary: Can't write XMP tags: to file Unknown namespace prefix for qualified name
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 8.3.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-24 12:01 UTC by Roberto
Modified: 2024-02-25 10:03 UTC (History)
1 user (show)

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


Attachments
Picture with issue (905.69 KB, image/jpeg)
2024-02-24 12:51 UTC, Roberto
Details
Original image XMP (4.85 KB, text/xml)
2024-02-24 18:20 UTC, Roberto
Details
PS edited image XMP (6.62 KB, text/xml)
2024-02-24 18:21 UTC, Roberto
Details
Out of the cel XML (1.09 KB, text/xml)
2024-02-24 23:08 UTC, Roberto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto 2024-02-24 12:01:35 UTC
SUMMARY
***
XMP tags and face regions are not being saved to file, even using exiftool.
It is not the case of XMP segment >64K:
    exiftool -G1 -a -s -xmp "PXL_4487.JPG"
    [XMP]           XMP                             : (Binary data 4703 bytes, use -b option to extract)
***


STEPS TO REPRODUCE
1. Scan/identify faces and set some tags in picture
2. Save metadata to file

OBSERVED RESULT
See comment with log extract.

EXPECTED RESULT
Face rectangles and tags should be saved to file. It seems only "XP Keywords" and "Keywords" are, nothing else.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Extract from log:
[1532] digikam.metaengine: "PXL_4487.JPG"  ==> New Iptc Keywords:  QList("Faces 1", "Collections", "Portraits", "NoNoNo", "Faces area range 10")
[1532] digikam.metaengine: MetaEngine::metadataWritingMode 0
[1532] digikam.metaengine: Will write Metadata to file "PXL_4487.JPG"
[1532] digikam.metaengine: Check ExifTool availability: true
[1532] digikam.metaengine: Exiv2 ( 3 ) :  XMP Toolkit error 102: Unknown namespace prefix for qualified name
[1532] 
[1532] digikam.metaengine: Exiv2 ( 3 ) :  Failed to encode XMP metadata.
[1532] 
[1532] digikam.metaengine: ExifTool "Apply Changes EXV" "-ifd0:all= -gps:all= -iptc:all= -file:comment= -xmp-dc:all= -xmp-lr:all= -xmp-mp:all= -xmp-xmp:all= -xmp-exif:all= -xmp-tiff:all= -xmp-xmpdm:all= -xmp-acdsee:all= -xmp-mwg-rs:all= -xmp-digikam:all= -xmp-mediapro:all= -xmp-iptccore:all= -xmp-microsoft:all= -xmp-photoshop:all= -TagsFromFile X:\\Users\\XXX\\AppData\\Local\\Temp\\MetaEngine-JEqalf-3dd77988.exv -all:all -codedcharacterset=UTF8 -TagsFromFile @ -makernotes -overwrite_original X:\\Users\\XXX\\Pictures\\PXL_4487.JPG"
[1532] digikam.metaengine: ExifToolProcess::readOutput(): ExifTool command completed
[1532] digikam.metaengine: ExifTool complete command for action "Apply Changes EXV" with elasped time (ms): 60
[1532] digikam.metaengine: ExifTool output:
[1532] digikam.metaengine: ---
[1532] digikam.metaengine:     1 image files updated 
[1532] 
[1532] digikam.metaengine: ---
[1532] digikam.metaengine: ExifTool parsed command for action "Apply Changes EXV" 0 properties decoded
[1532] digikam.metaengine: ExifTool complete "Apply Changes EXV" for "PXL_4487.JPG"
[1532] digikam.metaengine: File time stamp restored
[1532] digikam.metaengine: Metadata for file "2021-05-16 01h02 PXL_4487.JPG" written to file.
[1532] digikam.metaengine: Loading metadata with "Exiv2" backend from "PXL_4487.JPG"
[1532] digikam.dimg: "PXL_4487.JPG" : "JPEG" file identified
[1532] digikam.metaengine: DateTime (Exif digitalized): QDateTime(2021-05-16 01:02:00.000 UTC Qt::UTC)
[1532] digikam.metaengine: DateTime (digitization date): QDateTime(2021-05-16 01:02:00.000 UTC Qt::UTC)
Comment 1 Maik Qualmann 2024-02-24 12:07:59 UTC
I suspect a Google Pixel image based on the filename, this is fixed in digiKam-8.3.0.

See Bug 478899 and Bug 481268

Per-Release digiKam-8.3.0:

https://files.kde.org/digikam/

Maik
Comment 2 Roberto 2024-02-24 12:49:34 UTC
Log from latest 8.3:
[15312] digikam.metaengine: "PXL_4487.JPG"  ==> New Iptc Keywords:  QList("Faces area range 10", "Mia", "Collections", "Portraits")
[15312] digikam.metaengine: MetaEngine::metadataWritingMode 0
[15312] digikam.metaengine: Will write Metadata to file "PXL_4487.JPG"
[15312] digikam.metaengine: wroteComment:  true
[15312] digikam.metaengine: wroteEXIF:  true
[15312] digikam.metaengine: wroteIPTC:  true
[15312] digikam.metaengine: wroteXMP:  true
[15312] digikam.metaengine: Exiv2 ( 3 ) :  XMP Toolkit error 102: Unknown namespace prefix for qualified name
[15312] 
[15312] digikam.metaengine: Exiv2 ( 3 ) :  Failed to encode XMP metadata.
[15312] 
[15312] digikam.metaengine: File time stamp restored
[15312] digikam.metaengine: Metadata for file "2021-05-16 01h02 PXL_4487.JPG" written to file.
Comment 3 Roberto 2024-02-24 12:51:10 UTC
Created attachment 166061 [details]
Picture with issue
Comment 4 Maik Qualmann 2024-02-24 14:50:27 UTC
Git commit 7658d1e2e3584028346e4ad4393230019dbfb4ba by Maik Qualmann.
Committed on 24/02/2024 at 14:49.
Pushed by mqualmann into branch 'master'.

fix duplicate namespace URI registration for Google item container
FIXED-IN: 8.3.0

M  +1    -1    NEWS
M  +12   -4    core/libs/metadataengine/engine/metaengine.cpp

https://invent.kde.org/graphics/digikam/-/commit/7658d1e2e3584028346e4ad4393230019dbfb4ba
Comment 5 Maik Qualmann 2024-02-24 14:52:43 UTC
Do you still have an original image to compare whether Google created duplicate namespace URIs across Pixel Phone generations? Or whether your sample image was created incorrectly by Photoshop.

Maik
Comment 6 Roberto 2024-02-24 18:20:32 UTC
Attached output from exiftool -xmp -b for both original image and PS edited. Does this help?
Comment 7 Roberto 2024-02-24 18:20:57 UTC
Created attachment 166067 [details]
Original image XMP
Comment 8 Roberto 2024-02-24 18:21:16 UTC
Created attachment 166068 [details]
PS edited image XMP
Comment 9 Maik Qualmann 2024-02-24 22:10:24 UTC
The xmp from the original image has already been processed by Adobe Photoshop CS6.

Maik
Comment 10 Roberto 2024-02-24 23:08:17 UTC
Created attachment 166076 [details]
Out of the cel XML
Comment 11 Maik Qualmann 2024-02-25 10:03:58 UTC
Ok, then Adobe seems to have created duplicate elements under the same namespace URI:

Google:

http://ns.google.com/photos/1.0/container/ -> Container
http://ns.google.com/photos/1.0/container/item/ -> Item

Adobe:

http://ns.google.com/photos/1.0/container/ -> GContainer
http://ns.google.com/photos/1.0/container/item/ -> GContainerItem

Maik