Bug 348105 - TAGS MANAGER : Delete all unused tags
Summary: TAGS MANAGER : Delete all unused tags
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Manager (show other bugs)
Version: 4.4.0
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-22 14:16 UTC by Peter Albrecht
Modified: 2017-07-29 07:53 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Albrecht 2015-05-22 14:16:46 UTC
If your friends send images to you, which they have tagged, those "friend-tags" are imported with the image into digikam. Often, you use different tags as your friends, so you remove all those "friend-tags" from the images, you have just imported. (See bug #348104)
After this remove-action, you end up with a tag tree containing those "friend-tags", which are no longer assigned to a single image.

If you want to get rid of these obsolete tags, too, with digikam 4.4.0, I have to "walk" through the whole tag tree myself and press "Delete" + "Yes" on every single tag, which shows the use counter "(0)" after its name. (A very boring task.)

In this case, it would be very handy, if "Tags Manager" would provide a function as: "Delete all unused tags".
This function would collect all tags, which
   - are not assigned to an image
   - and have no child-tags (or only unused child-tags)
This list would be presented to the user:
  "Do you really want to delete the following tags?
     - sample tag 1
     - sample tag 2
     - ..."
So the user can delete all those no longer needed tags with a few clicks. (Leave the boring work to the computer ;)

Reproducible: Always
Comment 1 caulier.gilles 2015-05-24 18:08:00 UTC
Veaceslav,

This can be a job for tags Manager ?

Gilles
Comment 2 Veaceslav Munteanu 2015-05-25 17:15:54 UTC
Yes, this one can be implemented in Tags Manager. But I see that you first remove the tag from picture and then you remove the tag from tree.

Why won't you simply remove the tag from the tree? When you remove the tag from the tag tree, the tag is removed from all images.
Comment 3 Peter Albrecht 2015-05-26 17:08:35 UTC
Veaceslav,

my problem is: How to identify the tags to delete?

If I first remove all tags from the pictures in the album "pictures of friend Paul" (see bug #348104), I easily can identify tags, which are now obsolete, since they are not used any more.
Comment 4 Veaceslav Munteanu 2015-06-01 17:25:57 UTC
With this commit I implemented "Remove Unused Tags" in Tags Manager

http://quickgit.kde.org/?p=digikam.git&a=commit&h=6943606fa92404c296c23a8982df47339dc4164e

I will perform more tests, since is a dangerous option...
Comment 5 Peter Albrecht 2015-06-01 17:58:52 UTC
Thanks a lot! :)
Comment 6 caulier.gilles 2015-06-03 08:59:20 UTC
Git commit 727514c264edae32a55f8b99a627047a521d0177 by Gilles Caulier.
Committed on 03/06/2015 at 08:58.
Pushed by cgilles into branch 'frameworks'.

backport commit #6943606fa92404c296c23a8982df47339dc4164e from git/master to frameworks branch
Related: bug 309243

M  +123  -1    libs/tags/tagsmanager/tagsmanager.cpp
M  +4    -0    libs/tags/tagsmanager/tagsmanager.h

http://commits.kde.org/digikam/727514c264edae32a55f8b99a627047a521d0177
Comment 7 c.pergiel 2017-01-29 20:58:32 UTC
New installation Linux Mint serena, just mucking about, finding my way around. digiKam version 4.12.0. Added some pictures, which evidently added some tags. Deleted some of the pictures. Asked tag manager to delete all unused tags -> digiKam crashed.