Bug 425254 - Face tagging in Digikam: Exiv2 saves [XMP-mwg-rs] with "inf, inf, inf, inf" instead of numbers
Summary: Face tagging in Digikam: Exiv2 saves [XMP-mwg-rs] with "inf, inf, inf, inf" i...
Status: RESOLVED NOT A BUG
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Xmp (other bugs)
Version First Reported In: 7.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-12 12:51 UTC by Jonkeren
Modified: 2022-11-09 12:17 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 7.9.0
Sentry Crash Report:


Attachments
Debugview log (13.23 KB, text/plain)
2020-08-14 13:09 UTC, Jonkeren
Details
attachment-10864-0.html (2.59 KB, text/html)
2022-01-12 14:36 UTC, Jonkeren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonkeren 2020-08-12 12:51:21 UTC
Face tagging in Digikam: DigiKam or Exiv2 saves [XMP-mwg-rs] with "inf, inf, inf, inf" instead of numbers.

STEPS TO REPRODUCE
1. Open a picture in Digikam
2. Tag a face
3. View resulting metadata (for example with exiftool)

Output of exiftool -G1 -a -s before confirming a face with Digikam: (as you can see; it was already tagged)

[XMP-mwg-rs]    RegionAppliedToDimensionsH      : 2048
[XMP-mwg-rs]    RegionAppliedToDimensionsUnit   : pixel
[XMP-mwg-rs]    RegionAppliedToDimensionsW      : 1536
[XMP-mwg-rs]    RegionAreaH                     : 0.178125
[XMP-mwg-rs]    RegionAreaUnit                  : normalized
[XMP-mwg-rs]    RegionAreaW                     : 0.237500
[XMP-mwg-rs]    RegionAreaX                     : 0.60625
[XMP-mwg-rs]    RegionAreaY                     : 0.4421875
[XMP-mwg-rs]    RegionName                      : NAME
[XMP-mwg-rs]    RegionType                      : Face


Output of exiftool -G1 -a -s AFTER confirming a face with Digikam:

[XMP-mwg-rs]    RegionAppliedToDimensionsH      : 2048
[XMP-mwg-rs]    RegionAppliedToDimensionsUnit   : pixel
[XMP-mwg-rs]    RegionAppliedToDimensionsW      : 1536
[XMP-mwg-rs]    RegionName                      : NAME
[XMP-mwg-rs]    RegionType                      : Face
[XMP-mwg-rs]    RegionAreaX                     : inf
[XMP-mwg-rs]    RegionAreaY                     : inf
[XMP-mwg-rs]    RegionAreaW                     : inf
[XMP-mwg-rs]    RegionAreaH                     : inf
[XMP-mwg-rs]    RegionAreaUnit                  : normalized

As you can see, instead of numbers (for ex. RegionAreaX), it now only says "inf, inf, inf, inf".

Im I correct in understanding that this is not the expected behaviour?

If so, what to do to remedy this? Updating the internally used exiv2 version of Digikam?


OBSERVED RESULT
[XMP-mwg-rs]    RegionAreaX                     : inf
[XMP-mwg-rs]    RegionAreaY                     : inf
[XMP-mwg-rs]    RegionAreaW                     : inf
[XMP-mwg-rs]    RegionAreaH                     : inf


EXPECTED RESULT
[XMP-mwg-rs]    RegionAreaH                     : 0.178125
[XMP-mwg-rs]    RegionAreaW                     : 0.237500
[XMP-mwg-rs]    RegionAreaX                     : 0.60625
[XMP-mwg-rs]    RegionAreaY                     : 0.4421875


SOFTWARE/OS VERSIONS
Windows: 10, latest August 2020 update

ADDITIONAL INFORMATION
Digikam version 7.0.0 (build 16 july 2020)
Comment 1 Maik Qualmann 2020-08-12 18:11:19 UTC
The "inf" stands for infintity number. Since we use QString::number() to save the values as strings, they have to be created in digiKam. Such a number can be created artificially with qeral x = qInf(), QString::number(x) then shows "inf". The question is which operation results in an infinity number, please install DebugView from Microsoft.

Activate the debug output by setting an environment variable in the Windows environment editor.

Variable:
QT_LOGGING_RULES

Value:
digikam.*=true


Start DebugView and change a face in digiKam to get this wrong output, post the output of DebugView.

Maik
Comment 2 Jonkeren 2020-08-14 12:49:12 UTC
Hello @Mike Qualmann,

I have done so (use Debugview) while running DigiKam and tagging a face.

This is the output (Had to look for this in the file, as Digikam is constantly creating thumbnails, it seems).

-------

00020101	337.45898438	[9632] digikam.general: Found FacesEngine identity 5 for tag 2
00020102	337.46990967	[9632] digikam.general: Scheduled to write
00020103	337.47882080	[9632] digikam.metaengine: Set face region: inf inf inf inf
00020104	337.47888184	[9632] digikam.metaengine:     => set tag name: true
00020105	337.47894287	[9632] digikam.metaengine:     => set tag type: true
00020106	337.47900391	[9632] digikam.metaengine:     => set area struct: true
00020107	337.47906494	[9632] digikam.metaengine:     => set xpos: true
00020108	337.47912598	[9632] digikam.metaengine:     => set ypos: true
00020109	337.47915649	[9632] digikam.metaengine:     => set width: true
00020110	337.47921753	[9632] digikam.metaengine:     => set heigh: true
00020111	337.47927856	[9632] digikam.metaengine:     => set unit: true
00020112	337.47930908	[9632] digikam.general: Writing tags
00020113	337.47949219	[9632] digikam.general: -------------------------- New Keywords ("Jos Jonkeren", "Schoon Velde", "Nederland", "Drenthe", "Hoogeveen", "NLD", "SCAN")
00020114	337.47994995	[9632] digikam.metaengine: "C:/Users/jos/OneDrive/Afbeeldingen/Eigen foto's/1979/04/15/19790415-235727-Nederland-De Koog-De Koog.JPG"  ==> New Iptc Keywords:  ("Schoon Velde", "Nederland", "Drenthe", "Hoogeveen", "NLD", "SCAN", "Jos Jonkeren")
00020115	337.48043823	[9632] digikam.metaengine: MetaEngine::metadataWritingMode 3
00020116	337.48049927	[9632] digikam.metaengine: Will write Metadata to file "C:/Users/jos/OneDrive/Afbeeldingen/Eigen foto's/1979/04/15/19790415-235727-Nederland-De Koog-De Koog.JPG"
00020117	337.48474121	[9632] digikam.metaengine: wroteComment:  true
00020118	337.48486328	[9632] digikam.metaengine: wroteEXIF:  true
00020119	337.48495483	[9632] digikam.metaengine: wroteIPTC:  true
00020120	337.48510742	[9632] digikam.metaengine: wroteXMP:  true
00020121	337.49694824	[9632] digikam.metaengine: File time stamp restored
00020122	337.49716187	[9632] digikam.metaengine: Metadata for file "19790415-235727-Nederland-De Koog-De Koog.JPG" written to file.
00020123	337.49996948	[9632] digikam.facesengine: create recognizer
00020124	337.50152588	[9632] digikam.facedb: Start reading shape predictor file
00020125	337.50457764	[9632] digikam.dimg: "C:/Users/jos/OneDrive/Afbeeldingen/Eigen foto's/1979/04/15/19790415-235727-Nederland-De Koog-De Koog.JPG" : "JPEG" file identified
00020126	337.50473022	[9632] digikam.dimg.jpeg: Start of Image  ( 1 )
00020127	337.50482178	[9632] digikam.dimg.jpeg: JFIF APP0 marker: version 1.01, density 72x72  1  ( 1 )
00020128	337.50488281	[9632] digikam.dimg.jpeg: Miscellaneous marker 0xe1, length 5106  ( 1 )
00020129	337.50497437	[9632] digikam.dimg.jpeg: Miscellaneous marker 0xe1, length 7885  ( 1 )
00020130	337.50506592	[9632] digikam.dimg.jpeg: Miscellaneous marker 0xe2, length 574  ( 1 )
00020131	337.50512695	[9632] digikam.dimg.jpeg: Miscellaneous marker 0xed, length 412  ( 1 )
00020132	337.50518799	[9632] digikam.dimg.jpeg: Define Quantization Table 0  precision 0  ( 1 )
00020133	337.50524902	[9632] digikam.dimg.jpeg: Define Quantization Table 1  precision 0  ( 1 )
00020134	337.50534058	[9632] digikam.dimg.jpeg: Start Of Frame 0xc0: width=1536, height=2048, components=3  ( 1 )
00020135	337.50543213	[9632] digikam.dimg.jpeg:     Component 1: 2hx2v q=0  ( 1 )
00020136	337.50549316	[9632] digikam.dimg.jpeg:     Component 2: 1hx1v q=1  ( 1 )
00020137	337.50558472	[9632] digikam.dimg.jpeg:     Component 3: 1hx1v q=1  ( 1 )
00020138	337.50564575	[9632] digikam.dimg.jpeg: Define Huffman Table 0x00  ( 1 )
00020139	337.50573730	[9632] digikam.dimg.jpeg:           0   1   5   1   1   1   1   1  ( 2 )
00020140	337.50576782	[9632] digikam.dimg.jpeg:           1   0   0   0   0   0   0   0  ( 2 )
00020141	337.50588989	[9632] digikam.dimg.jpeg: Define Huffman Table 0x10  ( 1 )
00020142	337.50598145	[9632] digikam.dimg.jpeg:           0   2   1   3   3   2   4   3  ( 2 )
00020143	337.50607300	[9632] digikam.dimg.jpeg:           5   5   4   4   0   0   1 125  ( 2 )
00020144	337.50619507	[9632] digikam.dimg.jpeg: Define Huffman Table 0x01  ( 1 )
00020145	337.50628662	[9632] digikam.dimg.jpeg:           0   3   1   1   1   1   1   1  ( 2 )
00020146	337.50631714	[9632] digikam.dimg.jpeg:           1   1   1   0   0   0   0   0  ( 2 )
00020147	337.50640869	[9632] digikam.dimg.jpeg: Define Huffman Table 0x11  ( 1 )
00020148	337.50729370	[9632] digikam.dimg.jpeg:           0   2   1   2   4   4   3   4  ( 2 )
00020149	337.50732422	[9632] digikam.dimg.jpeg:           7   5   4   4   0   1   2 119  ( 2 )
00020150	337.50741577	[9632] digikam.dimg.jpeg: Start Of Scan: 3 components  ( 1 )
00020151	337.50744629	[9632] digikam.dimg.jpeg:     Component 1: dc=0 ac=0  ( 1 )
00020152	337.50762939	[9632] digikam.dimg.jpeg:     Component 2: dc=1 ac=1  ( 1 )
00020153	337.50775146	[9632] digikam.dimg.jpeg:     Component 3: dc=1 ac=1  ( 1 )
00020154	337.50796509	[9632] digikam.dimg.jpeg:   Ss=0, Se=63, Ah=0, Al=0  ( 1 )
00020155	337.52059937	[9632] digikam.database: Scanning took 21 ms
00020156	337.52566528	[9632] digikam.database: Finishing took 5 ms
00020157	337.52691650	[9632] digikam.dimg.jpeg: End Of Image  ( 1 )

-----

I do not see any error; but I do see that on the third line it already says "Set face region: inf inf inf inf".
Anything else I can try to find out the cause?

Thanks
Comment 3 Jonkeren 2020-08-14 13:09:49 UTC
Created attachment 130868 [details]
Debugview log

UPDATE!

I have now done:

1. select a picture
2. remove all faces through digikam right-click menu
3. scan the picture for faces again
4. name the found face.

That seems to work correctly! The metadata is correctly written.
See attached log file of this operation.


So it seems that this is reproducible:
======================================
A) In digikam, go to People -> Unknown
B) See the metadata, see that it already has XMP-MWG-RS face tags (for example from Picasa)
C) Name the face
D) --> Check output -> Face Tag data "infinity". "inf, inf, inf, inf".

Is this confirmed?

Thank you.
Comment 4 Maik Qualmann 2020-08-15 09:11:23 UTC
From her log:
digikam.metaengine: Set face region: inf inf inf inf

The qreal values are already incorrect, so there must be an error when calculating the coordinates.
But I cannot reproduce the problem here, not even with images that come from Picasa. What type of database are you using? SQLite or MySQL?

Maik
Comment 5 caulier.gilles 2021-05-05 05:50:18 UTC
Jonkeren,

Do you seen the previous message from Maik ?

Gilles Caulier
Comment 6 caulier.gilles 2021-05-05 05:53:31 UTC
Can you share a JPEG image as 19790415-235727-Nederland-De Koog-De Koog.JPG not face tagged, and taken with the same camera ?
Comment 7 Jonkeren 2022-01-12 14:36:34 UTC
Created attachment 145366 [details]
attachment-10864-0.html

Hi Maik.

Several years later now....; back to using Digikam. Still; the same issue
:-(

I am using Digikam 7.4.0 release on Windows 10.
Still, on a previously face-tagged image; region values inf, inf, inf, inf
are written.

I am using the internal MySQL db (on the same machine).

Looks like Digikam does not take into consideration the correct size /
dimensions of the image, when a face tag already existed?

Met vriendelijke groet, mit freundlichem Gruß, kind regards,

[image: Handtekening Jos]

Albert Johan (Jos) Jonkeren

Op za 15 aug. 2020 om 11:11 schreef Maik Qualmann <bugzilla_noreply@kde.org
>:

> https://bugs.kde.org/show_bug.cgi?id=425254
>
> --- Comment #4 from Maik Qualmann <metzpinguin@gmail.com> ---
> From her log:
> digikam.metaengine: Set face region: inf inf inf inf
>
> The qreal values are already incorrect, so there must be an error when
> calculating the coordinates.
> But I cannot reproduce the problem here, not even with images that come
> from
> Picasa. What type of database are you using? SQLite or MySQL?
>
> Maik
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You reported the bug.
Comment 8 Jonkeren 2022-10-24 14:34:05 UTC
Closed this one, as I now think it had to do with incompatability of old picasa software // user error (made face tags corrupt).
If this show up again I will re-post.
Comment 9 José Oliver-Didier 2022-11-09 12:17:50 UTC
I have a couple of photos with this issue. On my Windows machine I used the command:

findstr /m /s "MPReg:Rectangle=\"inf" *.jpg > inf_issue.txt

To generate a list of the affected files. The latest file with this issue was from June 2022. I have spent hours trying to reproduce this bug to no avail. The only applications I have been using which manipulate file metadata are Digikam and GeoSetter (which uses exifool). However, all the affected files were in a OneDrive synced folder. I have stumbled upon some odd behavior lately with OneDrive and image files.