Summary: | MWG "Applied To" state (mwg-rs:AppliedToDimensions XMP tag) is not included when writing Face metadata to file - Use ExifTool | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | José Oliver-Didier <jose_oliver> |
Component: | Metadata-ExifTool | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, ertymail, jose_oliver, metzpinguin |
Priority: | NOR | ||
Version: | 7.2.0 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | https://invent.kde.org/graphics/digikam/commit/8f9bb6617460fd337ab2657b1c76a3e5421fa448 | Version Fixed In: | 7.4.0 |
Sentry Crash Report: | |||
Attachments: |
Example Files
Sample - Expected XMP metadata tag |
Description
José Oliver-Didier
2020-11-17 01:36:54 UTC
Created attachment 135332 [details]
Example Files
Adding example files:
1. Einstein.jpg is a 800x1050 image with MWG regions applied. AppliedTo dimensions are h=1050 and w=800.
2. Einstein_cropped.jpg is Einstein.jpg cropped to 534x700 with an application which does not correct the AppliedTo settings. AppliedTo remain at h=1050 and w=800, thus indicating an invalid MWG.
Suggested Digikam behavior when an invalid MWG is encountered:
1. Read the names of the MWG face tags and add them to People tags- as the face names may still be valid information and should not be lost on crop.
2. Do not apply the face regions encountered in the file metadata, as they are likely invalid.
3. Re-apply face detection/recognition so that the user can correct the face region.
This report is open for 7.1.0 release. It can be reproduced with current 7.2.0 pre release ? https://files.kde.org/digikam/ Gilles Caulier Yes, I can reproduce it on 7.2.0-rc (ffbcb5f3) Created attachment 135563 [details] Sample - Expected XMP metadata tag Adding sample XMP file on the expected MWG XML structure. XMP extracted from jpg using exiftool and created mwg from MS People Tag using method described here: https://jmoliver.wordpress.com/2017/02/19/converting-and-exporting-windows-photo-gallery-people-tags/ Note "AppliedToDimensions" tag: <mwg-rs:AppliedToDimensions rdf:parseType='Resource'> <stDim:h>1050</stDim:h> <stDim:unit>pixel</stDim:unit> <stDim:w>800</stDim:w> </mwg-rs:AppliedToDimensions> Since Exiftool support has been introduced to Digikam in 7.3.0, could Exiftool be used to read as well as write these tags to file when Face Regions are edited? Exiftool Ref: https://exiftool.org/TagNames/MWG.html#Regions yes, sure ExifTool can used for this task, if Exiv2 is not able to do it as well. The digiKam Exiftool CC+/Qt interface that we write in digiKam core is designed to be extendable for this kind of use. Gilles Caulier Exiv2 already supports the AppliedToDimensions tag. Maik *** Bug 445440 has been marked as a duplicate of this bug. *** As I described in Bug 445440, this issue also prevents the correct import of face tags into Lightroom. Because Lightroom considers mwg-rs without dimensions information invalid. I've made many tries and that's the only reason. Git commit 8f9bb6617460fd337ab2657b1c76a3e5421fa448 by Maik Qualmann. Committed on 14/11/2021 at 13:15. Pushed by mqualmann into branch 'master'. add write mwg-rs:AppliedToDimensions XMP tag structure Note: digiKam itself still ignores AppliedToDimensions when importing. Related: bug 445440 FIXED-IN: 7.4.0 M +2 -2 NEWS M +5 -3 core/libs/fileactionmanager/metadatahub.cpp M +1 -1 core/libs/metadataengine/dmetadata/dmetadata.h M +34 -2 core/libs/metadataengine/dmetadata/dmetadata_faces.cpp https://invent.kde.org/graphics/digikam/commit/8f9bb6617460fd337ab2657b1c76a3e5421fa448 This is great news! Lack of this tag had me worried for proper support of MWG Face Regions. However, how will Digikam manage images with invalid AppliedToDimensions? When opening the bug I stated: "In the event that the AppliedToDimensions and actual image dimensions do not match, Digikam may choose to ignore/invalidate the face regions so they can be re-applied." What I mean with that statement is that if an image is cropped using another application which cannot adjust the face regions accordingly, the existing face regions should be ignored but the People's names should be respected so that it can be easier to re-tag them later within Digikam. digiKam will definitely ignore the absence of the AppliedToDimensions tag. If a user had to restore their database, all of the face regions made so far would not be restored. That's why I find the Lightroom behavior very strange. If the AppliedToDimensions tag is available, we can include it, I will implement it soon. At the moment I don't know whether the image orientation has to be ignored with the AppliedToDimensions tag and how other programs behave. Since we still do not know the orientation for which the face regions were saved. Maik |