Bug 418213

Summary: When I add a Person to tagged Faces and delete it, it already exist. No recreation possible
Product: [Applications] digikam Reporter: r4c3
Component: Tags-KeywordsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: metzpinguin
Priority: NOR    
Version First Reported In: 7.0.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 7.0.0
Sentry Crash Report:

Description r4c3 2020-02-26 08:49:26 UTC
SUMMARY

When I add a Person to the Tagged Person section. For example "1" and delete it. It works but when I want to create this Person "1" again. It already exist.

STEPS TO REPRODUCE

Reproducible:
Always

The same problem i have with "unconfirmed" faces. I delete it and can not create it anymore.


Operating System: Manjaro Linux 
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.66.0
Qt Version: 5.14.1
Kernel Version: 4.19.102-1-MANJARO
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-7200U CPU @ 2.50GHz
Memory: 7,7 GiB
Comment 1 r4c3 2020-02-26 08:49:41 UTC
used image

digikam-7.0.0-beta3-20200207T075214-x86-64-debug.appimage
Comment 2 Maik Qualmann 2020-02-26 09:54:23 UTC
I cannot reproduce it here in a first test. The "unconfirmed" tag is automatically generated again when the facial engine needs it.

Please post the output from the console when trying to re-create the tag. Do you use SQLite or MySQL?

Maik
Comment 3 r4c3 2020-02-26 11:28:48 UTC
Hello Maik,

i use sqllite.
Here my Logfile:

[New Thread 0x7fff9cff9700 (LWP 457)]
unknown: Unhandled container to remove :  Digikam::DigikamApp
[New Thread 0x7fff7a366700 (LWP 470)]
[New Thread 0x7fff79b65700 (LWP 471)]
[New Thread 0x7fff79364700 (LWP 472)]
[New Thread 0x7fff78b63700 (LWP 473)]
[New Thread 0x7fff63fff700 (LWP 474)]
[New Thread 0x7fff637fe700 (LWP 475)]
[Thread 0x7fff7a366700 (LWP 470) exited]
[Thread 0x7fff79364700 (LWP 472) exited]
[New Thread 0x7fff79364700 (LWP 476)]
[New Thread 0x7fff7a366700 (LWP 477)]
[New Thread 0x7fff62ffd700 (LWP 478)]
[Thread 0x7fff79b65700 (LWP 471) exited]
[Thread 0x7fff78b63700 (LWP 473) exited]
[Thread 0x7fff63fff700 (LWP 474) exited]
[New Thread 0x7fff63fff700 (LWP 484)]
[Thread 0x7fff637fe700 (LWP 475) exited]
[Detaching after fork from child process 493]
unknown: failed to create compose table
[Thread 0x7fff9effd700 (LWP 452) exited]
[Thread 0x7fff79364700 (LWP 476) exited]
[Thread 0x7fff7a366700 (LWP 477) exited]
[Thread 0x7fff63fff700 (LWP 484) exited]
[New Thread 0x7fff63fff700 (LWP 554)]
[New Thread 0x7fff7a366700 (LWP 555)]
[Thread 0x7fff63fff700 (LWP 554) exited]
[Thread 0x7fff7a366700 (LWP 555) exited]
[Thread 0x7fffb6379700 (LWP 446) exited]
Digikam::ModelCompleter::slotRowsAboutToBeRemoved: idToTextHash seems to be out of sync with the model. There is no entry for model index QModelIndex(192,0,0x1d51e00,Digikam::TagPropertiesFilterModel(0x1de4e10))
[New Thread 0x7fffb6379700 (LWP 571)]
[New Thread 0x7fff7a366700 (LWP 572)]
[New Thread 0x7fff63fff700 (LWP 573)]
[New Thread 0x7fff79364700 (LWP 574)]
[New Thread 0x7fff9effd700 (LWP 575)]
[Thread 0x7fffb6379700 (LWP 571) exited]
[Thread 0x7fff7a366700 (LWP 572) exited]
[Thread 0x7fffb5377700 (LWP 449) exited]

I created "3" and removed it, after it i can not recreate it.
Comment 4 Maik Qualmann 2020-02-26 11:43:23 UTC
I forgot, please activate logging beforehand with:

export QT_LOGGING_RULES="digikam.*=true"

Maik
Comment 5 r4c3 2020-02-26 20:18:14 UTC
Okay.
I hope I have it done the right way.

Because there is no big difference in the logfile.

./digikam-7.0.0-beta3-20200207T075214-x86-64-debug.appimage debug export QT_LOGGING_RULES="digikam*=true"


Starting program: /tmp/.mount_digikaqh0ex0/usr/bin/digikam export QT_LOGGING_RULES=digikam\*=true
/usr/lib/../share/gcc-9.2.0/python/libstdcxx/v6/xmethods.py:731: SyntaxWarning: list indices must be integers or slices, not str; perhaps you missed a comma?
  refcounts = ['_M_refcount']['_M_pi']
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffd3f0a700 (LWP 6170)]
[New Thread 0x7fffcb5c7700 (LWP 6176)]
[New Thread 0x7fffcadc6700 (LWP 6177)]
[New Thread 0x7fffca5c5700 (LWP 6178)]
[Thread 0x7fffca5c5700 (LWP 6178) exited]
[New Thread 0x7fffca5c5700 (LWP 6196)]
[New Thread 0x7fffb7b7c700 (LWP 6197)]
[Detaching after fork from child process 6198]
[Detaching after fork from child process 6199]
[New Thread 0x7fffb737b700 (LWP 6202)]
[New Thread 0x7fffb6b7a700 (LWP 6203)]
[New Thread 0x7fffb6379700 (LWP 6204)]
[New Thread 0x7fffb5b78700 (LWP 6205)]
[New Thread 0x7fffb5377700 (LWP 6206)]
[New Thread 0x7fffb4b76700 (LWP 6207)]
[New Thread 0x7fff97fff700 (LWP 6208)]
[New Thread 0x7fff977fe700 (LWP 6209)]
[New Thread 0x7fff96ffd700 (LWP 6210)]
[New Thread 0x7fff967fc700 (LWP 6211)]
[New Thread 0x7fff95ffb700 (LWP 6212)]
[New Thread 0x7fff957fa700 (LWP 6213)]
QtAV 1.13.0(Feb  7 2020, 05:19:20)
Multimedia framework base on Qt and FFmpeg.
Distributed under the terms of LGPLv2.1 or later.
Shanghai, China Copyright (C) 2012-2019 Wang Bin (aka. Lucas Wang) wbsecg1@gmail.com
Donate: http://qtav.org/donate.html
Source: https://github.com/wang-bin/QtAV
Home page: http://qtav.org
[New Thread 0x7fff94ff9700 (LWP 6219)]
unknown: Unhandled container to remove :  Digikam::DigikamApp
[New Thread 0x7fff7e366700 (LWP 6230)]
[New Thread 0x7fff7db65700 (LWP 6231)]
[New Thread 0x7fff7d364700 (LWP 6232)]
[New Thread 0x7fff7cb63700 (LWP 6233)]
[New Thread 0x7fff63fff700 (LWP 6234)]
[New Thread 0x7fff637fe700 (LWP 6235)]
[Thread 0x7fff7d364700 (LWP 6232) exited]
[Thread 0x7fff7e366700 (LWP 6230) exited]
[New Thread 0x7fff7e366700 (LWP 6236)]
[New Thread 0x7fff7d364700 (LWP 6237)]
[New Thread 0x7fff62ffd700 (LWP 6238)]
[Thread 0x7fff7cb63700 (LWP 6233) exited]
[Thread 0x7fff7db65700 (LWP 6231) exited]
[Thread 0x7fff63fff700 (LWP 6234) exited]
[New Thread 0x7fff63fff700 (LWP 6244)]
[Thread 0x7fff637fe700 (LWP 6235) exited]
[Detaching after fork from child process 6250]
unknown: failed to create compose table
[Thread 0x7fff96ffd700 (LWP 6210) exited]
[New Thread 0x7fff96ffd700 (LWP 6316)]
[New Thread 0x7fff637fe700 (LWP 6317)]
[Thread 0x7fff96ffd700 (LWP 6316) exited]
[Thread 0x7fff637fe700 (LWP 6317) exited]
[Thread 0x7fff7d364700 (LWP 6237) exited]
[Thread 0x7fff7e366700 (LWP 6236) exited]
[Thread 0x7fff63fff700 (LWP 6244) exited]
Digikam::ModelCompleter::slotRowsAboutToBeRemoved: idToTextHash seems to be out of sync with the model. There is no entry for model index QModelIndex(192,0,0x26bd530,Digikam::TagPropertiesFilterModel(0x1d58080))
Digikam::ModelCompleter::slotRowsAboutToBeRemoved: idToTextHash seems to be out of sync with the model. There is no entry for model index QModelIndex(192,0,0x23d01c0,Digikam::TagPropertiesFilterModel(0x1dea5a0))
[New Thread 0x7fff63fff700 (LWP 6323)]
[New Thread 0x7fff7e366700 (LWP 6324)]
[Thread 0x7fffb5377700 (LWP 6206) exited]
[New Thread 0x7fffb5377700 (LWP 6330)]
[New Thread 0x7fff7d364700 (LWP 6331)]
[New Thread 0x7fff637fe700 (LWP 6332)]
[Thread 0x7fff63fff700 (LWP 6323) exited]
[Thread 0x7fff7e366700 (LWP 6324) exited]
Comment 6 Maik Qualmann 2020-02-26 21:13:20 UTC
No, first run the "export" line alone, do not pass it to the AppImage.

Another question, if you deleted the tag, will it disappear from the tree view? And after a restart, is it gone?

Maik
Comment 7 r4c3 2020-02-27 20:22:38 UTC
Steps:
1. Create a Person with the name "6"
2. Delete the Person with the name "6"
--> The Person disappears from the view
3. I try to recreate the Person "6"
--> The Program tells me that the person already exist. In the view there is no Person with the name "6" to see. But in the creation menu there ist a entry with "/personen/6" and when i click on it and agree the error
Person already exist is shown


So this is the Log:

unknown:           0   2   1   3   3   2   4   3  ( 2 )
unknown:           5   5   4   4   0   0   1 125  ( 2 )
unknown: Define Huffman Table 0x01  ( 1 )
unknown:           0   3   1   1   1   1   1   1  ( 2 )
unknown:           1   1   1   0   0   0   0   0  ( 2 )
unknown: Define Huffman Table 0x11  ( 1 )
unknown:           0   2   1   2   4   4   3   4  ( 2 )
unknown:           7   5   4   4   0   1   2 119  ( 2 )
unknown: Start Of Scan: 3 components  ( 1 )
unknown:     Component 1: dc=0 ac=0  ( 1 )
unknown:     Component 2: dc=1 ac=1  ( 1 )
unknown:     Component 3: dc=1 ac=1  ( 1 )
unknown:   Ss=0, Se=63, Ah=0, Al=0  ( 1 )
unknown: End Of Image  ( 1 )
[Thread 0x7fff96ffd700 (LWP 25155) exited]
[Thread 0x7fffb5377700 (LWP 25151) exited]
Digikam::ActionThreadBase::setMaximumNumberOfThreads: Using  4  CPU core to run threads
[New Thread 0x7fffb5377700 (LWP 25278)]
Digikam::ActionThreadBase::run: Action Thread run  1  new jobs
[New Thread 0x7fff96ffd700 (LWP 25279)]
[Thread 0x7fff62ffd700 (LWP 25183) exited]
Digikam::ActionThreadBase::slotJobFinished: One job is done
Digikam::ActionThreadBase::cancel: Cancel Main Thread
[Thread 0x7fff96ffd700 (LWP 25279) exited]
[Thread 0x7fffb5377700 (LWP 25278) exited]
[Thread 0x7fff63fff700 (LWP 25194) exited]
[Thread 0x7fff7d364700 (LWP 25182) exited]
unknown: failed to create compose table
Digikam::TagEditDlg::createTAlbum: ("Personen", "6")
Digikam::TagEditDlg::createTAlbum: "Personen"  ::  "/Personen"
Digikam::TagEditDlg::createTAlbum: "6"  ::  "/Personen/6"
Digikam::FaceTagsHelper::tagForName: Converting proposed tag to person, full name "6"
Digikam::ItemMarkerTiler::slotSourceModelReset: ----
Digikam::ItemMarkerTiler::slotSourceModelReset: ----
Digikam::ActionThreadBase::setMaximumNumberOfThreads: Using  4  CPU core to run threads
[New Thread 0x7fff7d364700 (LWP 25310)]
Digikam::ActionThreadBase::run: Action Thread run  1  new jobs
[New Thread 0x7fff63fff700 (LWP 25311)]
Digikam::ItemQueryBuilder::buildQueryFromXml: " ( ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) OR ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) OR ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) ) "
Digikam::ItemLister::listImageTagPropertySearch: Search query:
 "SELECT DISTINCT Images.id, Images.name, Images.album,        Albums.albumRoot,        ImageInformation.rating, Images.category,        ImageInformation.format, ImageInformation.creationDate,        Images.modificationDate, Images.fileSize,        ImageInformation.width,  ImageInformation.height,        ImageTagProperties.value, ImageTagProperties.property, ImageTagProperties.tagid  FROM Images        INNER JOIN ImageTagProperties ON ImageTagProperties.imageid=Images.id        LEFT JOIN ImageInformation ON Images.id=ImageInformation.imageid        INNER JOIN Albums           ON Albums.id=Images.album WHERE Images.status=1 AND (  ( ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) OR ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) OR ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) )  );" 
 (QVariant(int, 236), QVariant(int, 236), QVariant(QString, "autodetectedPerson"), QVariant(int, 236), QVariant(int, 236), QVariant(QString, "autodetectedFace"), QVariant(int, 236), QVariant(int, 236), QVariant(QString, "tagRegion"))
Digikam::ItemLister::listImageTagPropertySearch: Search result: 0
Digikam::ItemAlbumModel::slotData: Data From DBJobsThread is null:  true
Digikam::ActionThreadBase::cancel: Cancel Main Thread
[Thread 0x7fff7d364700 (LWP 25310) exited]
Digikam::ActionThreadBase::slotJobFinished: One job is done
Digikam::ActionThreadBase::cancel: Cancel Main Thread
[Thread 0x7fff63fff700 (LWP 25311) exited]
Digikam::ItemMarkerTiler::slotSourceModelReset: ----
Digikam::ModelCompleter::slotRowsAboutToBeRemoved: idToTextHash seems to be out of sync with the model. There is no entry for model index QModelIndex(192,0,0x26bfba0,Digikam::TagPropertiesFilterModel(0x1d56cd0))
Digikam::ModelCompleter::slotRowsAboutToBeRemoved: idToTextHash seems to be out of sync with the model. There is no entry for model index QModelIndex(192,0,0x2259180,Digikam::TagPropertiesFilterModel(0x1de98e0))
Digikam::TagModificationHelper::slotMultipleFaceTagDel: Deleting person tag properties for tag  "6"  with uuid  ""
[Thread 0x7fffb4b76700 (LWP 25152) exited]
Digikam::ItemMarkerTiler::slotSourceModelReset: ----
Digikam::ItemMarkerTiler::slotSourceModelReset: ----
Digikam::ActionThreadBase::setMaximumNumberOfThreads: Using  4  CPU core to run threads
[New Thread 0x7fffb4b76700 (LWP 25327)]
Digikam::ActionThreadBase::run: Action Thread run  1  new jobs
[New Thread 0x7fff63fff700 (LWP 25328)]
Digikam::ItemQueryBuilder::buildQueryFromXml: " ( ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) OR ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) OR ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) ) "
Digikam::ItemLister::listImageTagPropertySearch: Search query:
 "SELECT DISTINCT Images.id, Images.name, Images.album,        Albums.albumRoot,        ImageInformation.rating, Images.category,        ImageInformation.format, ImageInformation.creationDate,        Images.modificationDate, Images.fileSize,        ImageInformation.width,  ImageInformation.height,        ImageTagProperties.value, ImageTagProperties.property, ImageTagProperties.tagid  FROM Images        INNER JOIN ImageTagProperties ON ImageTagProperties.imageid=Images.id        LEFT JOIN ImageInformation ON Images.id=ImageInformation.imageid        INNER JOIN Albums           ON Albums.id=Images.album WHERE Images.status=1 AND (  ( ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) OR ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) OR ( (ImageTagProperties.tagid=? OR ImageTagProperties.tagid IN (SELECT id FROM TagsTree WHERE pid=?)) AND ImageTagProperties.property=?  ) )  );" 
 (QVariant(int, 19), QVariant(int, 19), QVariant(QString, "autodetectedPerson"), QVariant(int, 19), QVariant(int, 19), QVariant(QString, "autodetectedFace"), QVariant(int, 19), QVariant(int, 19), QVariant(QString, "tagRegion"))
Digikam::ItemMarkerTiler::slotSourceModelReset: ----
Digikam::ItemLister::listImageTagPropertySearch: Search result: 18842
[New Thread 0x7fff7d364700 (LWP 25329)]
[New Thread 0x7fff96ffd700 (LWP 25330)]
[New Thread 0x7fff7db65700 (LWP 25331)]
Digikam::ActionThreadBase::cancel: Cancel Main Thread
Digikam::ActionThreadBase::slotJobFinished: One job is done
[Thread 0x7fffb4b76700 (LWP 25327) exited]
Digikam::TagEditDlg::createTAlbum: ("Personen", "6")
Digikam::TagEditDlg::createTAlbum: "Personen"  ::  "/Personen"
Digikam::TagEditDlg::createTAlbum: "6"  ::  "/Personen/6"
Digikam::ActionThreadBase::cancel: Cancel Main Thread
[Thread 0x7fff63fff700 (LWP 25328) exited]
Comment 8 r4c3 2020-02-27 20:25:55 UTC
https://www.bilder-upload.eu/bild-a89e1e-1582835132.png.html

this is a picture of the menu
Comment 9 r4c3 2020-02-27 20:27:33 UTC
Additional Information after a restart the Persons also gone.

Martin
Comment 10 Maik Qualmann 2020-02-28 07:36:36 UTC
Ok, with the log I now understand which function you call to delete the face tags from the images. This function should only remove the face rectangles and tags from the images, but not delete itself or destroy its properties. I will fix it.

Maik
Comment 11 Maik Qualmann 2020-02-29 07:46:53 UTC
In principle, the function does what it is supposed to do. All face rectangles and tags are deleted from the images, the identity in the face DB is deleted. The tag itself is reset to the status of a normal tag. Therefore, it also disappears from the tree view of persons. But the tag still exists, look into the other tags tree views. Therefore, you cannot create it again.

What do you expect?

1. Delete the tag completely?
2. The tag remains as a person tag?

Maik
Comment 12 r4c3 2020-02-29 16:07:31 UTC
So the problem begins with removing the Tag "unconfirmed" from the tree persons.
This was a mistake by myself. So I want to recreate the unconfirmed persons in the tree with a right click and add a person with the name "unconfirmed" or in German "unbestätigt".

This is not possible, Digikam says the tag already exist. But the problem is it exist but I cannot see it in the tree view, because i delete it.

The example with person "6" was only to show you the problem.

Is it clear?

Martin
Comment 13 r4c3 2020-02-29 16:08:46 UTC
Or is it a fault by myself and i delete the tags not the right way?
Comment 14 Maik Qualmann 2020-03-01 06:39:39 UTC
After a long code review, the function remains as it is. It is the opposite of converting a tag to a person tag. You can delete tags in the Tags Manager or in the other tags views.

Maik