Batch processing to remove unwanted parent tags?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Batch processing to remove unwanted parent tags?

Info Munky
Digikam 4.12.0 on Linux Mint 18 Cinnamon

I'm considering moving from Shotwell (the simplicity of which I like) to
Digikam, primarily because Shotwell doesn't easily allow me to
dissociate RAW files from JPGs after import. I've been experimenting
with Digikam, getting to grips with it and starting to really love it!

Main issue I need to resolve at the moment is how to remove parent tags
(in my JPG metadata from Shotwell) where I have a child or children of
that parent tag.

If my tag hierarchy is something like this...

a
     aa
     ab
     ac
         aca
b
     ba

... and photo 1 has tag 'aca' set, I currently have tags 'a', 'ac' and
'aca' showing against the photo either in the tool tip or under the
thumbnail. I have seen that after removing 'a' and 'ac', the photo still
shows up in a search for either of these tags, because 'aca' is a
descendent. So I'd like to remove 'a' and 'ac' from photo 1 to remove
clutter when the tags are listed.

Obviously I can remove these one by one, but am wondering whether
there's a nice script somewhere to do this on a batch basis?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Batch processing to remove unwanted parent tags?

Remco Viëtor
On dimanche 15 janvier 2017 12:44:50 CET Info Munky wrote:

> Digikam 4.12.0 on Linux Mint 18 Cinnamon
>
> I'm considering moving from Shotwell (the simplicity of which I like) to
> Digikam, primarily because Shotwell doesn't easily allow me to
> dissociate RAW files from JPGs after import. I've been experimenting
> with Digikam, getting to grips with it and starting to really love it!
>
> Main issue I need to resolve at the moment is how to remove parent tags
> (in my JPG metadata from Shotwell) where I have a child or children of
> that parent tag.
>
> If my tag hierarchy is something like this...
>
> a
>      aa
>      ab
>      ac
>          aca
> b
>      ba
>
> ... and photo 1 has tag 'aca' set, I currently have tags 'a', 'ac' and
> 'aca' showing against the photo either in the tool tip or under the
> thumbnail. I have seen that after removing 'a' and 'ac', the photo still
> shows up in a search for either of these tags, because 'aca' is a
> descendent. So I'd like to remove 'a' and 'ac' from photo 1 to remove
> clutter when the tags are listed.
>
> Obviously I can remove these one by one, but am wondering whether
> there's a nice script somewhere to do this on a batch basis?
>
> Thanks

In the left sidebar, you can search for /select images by tag over the whole
collection. Do that for your tag "aca", select all, and in the right side bar
uncheck the tags a and ac. That should do the trick.

It gets a bit unpleasant if you have a very large tag tree, though.
Reply | Threaded
Open this post in threaded view
|

Re: Batch processing to remove unwanted parent tags?

AndriusWild
In reply to this post by Info Munky
I would try that on few files or on a folder and check the results with "exiftool -s FILE " to make sure you like it.
Digikam writes tags to many metadata fields not only to Keyword.

Also I think Digikam used to write a|aa|aca to the Keyword field but now it only writes aca there but full hierarchy a|aa|aca being written to XMP Keywords and other fields. 
Please correct me if I wrong.

Sent from my Samsung Galaxy smartphone.

-------- Original message --------
From: Remco Viëtor <[hidden email]>
Date: 2017-01-15 7:10 AM (GMT-07:00)
To: digiKam - Home Manage your photographs as a professional with the power of open source <[hidden email]>
Subject: Re: Batch processing to remove unwanted parent tags?

On dimanche 15 janvier 2017 12:44:50 CET Info Munky wrote:

> Digikam 4.12.0 on Linux Mint 18 Cinnamon
>
> I'm considering moving from Shotwell (the simplicity of which I like) to
> Digikam, primarily because Shotwell doesn't easily allow me to
> dissociate RAW files from JPGs after import. I've been experimenting
> with Digikam, getting to grips with it and starting to really love it!
>
> Main issue I need to resolve at the moment is how to remove parent tags
> (in my JPG metadata from Shotwell) where I have a child or children of
> that parent tag.
>
> If my tag hierarchy is something like this...
>
> a
>      aa
>      ab
>      ac
>          aca
> b
>      ba
>
> ... and photo 1 has tag 'aca' set, I currently have tags 'a', 'ac' and
> 'aca' showing against the photo either in the tool tip or under the
> thumbnail. I have seen that after removing 'a' and 'ac', the photo still
> shows up in a search for either of these tags, because 'aca' is a
> descendent. So I'd like to remove 'a' and 'ac' from photo 1 to remove
> clutter when the tags are listed.
>
> Obviously I can remove these one by one, but am wondering whether
> there's a nice script somewhere to do this on a batch basis?
>
> Thanks

In the left sidebar, you can search for /select images by tag over the whole
collection. Do that for your tag "aca", select all, and in the right side bar
uncheck the tags a and ac. That should do the trick.

It gets a bit unpleasant if you have a very large tag tree, though.
Reply | Threaded
Open this post in threaded view
|

Re: Batch processing to remove unwanted parent tags?

Info Munky

Thanks both. There's a whole range of different tag families I need to deal with, so what I really need is a script that does something like this:

iterate through photos
    IF photo has tags
        iterate through tag tree AS $tag
            IF $tag has child tags
                remove $tag

This leaves only each node of the tag hierarchy which has no dependents.
If there's nothing available to do this at present, I might have a look at the schema and write an SQL query to do it.
Thanks for the pointer on various EXIF fields being used for tags/keywords.

On 15/01/17 15:32, Andrey Goreev wrote:
I would try that on few files or on a folder and check the results with "exiftool -s FILE " to make sure you like it.
Digikam writes tags to many metadata fields not only to Keyword.

Also I think Digikam used to write a|aa|aca to the Keyword field but now it only writes aca there but full hierarchy a|aa|aca being written to XMP Keywords and other fields. 
Please correct me if I wrong.

Sent from my Samsung Galaxy smartphone.

-------- Original message --------
From: Remco Viëtor [hidden email]
Date: 2017-01-15 7:10 AM (GMT-07:00)
To: digiKam - Home Manage your photographs as a professional with the power of open source [hidden email]
Subject: Re: Batch processing to remove unwanted parent tags?

On dimanche 15 janvier 2017 12:44:50 CET Info Munky wrote:
> Digikam 4.12.0 on Linux Mint 18 Cinnamon
>
> I'm considering moving from Shotwell (the simplicity of which I like) to
> Digikam, primarily because Shotwell doesn't easily allow me to
> dissociate RAW files from JPGs after import. I've been experimenting
> with Digikam, getting to grips with it and starting to really love it!
>
> Main issue I need to resolve at the moment is how to remove parent tags
> (in my JPG metadata from Shotwell) where I have a child or children of
> that parent tag.
>
> If my tag hierarchy is something like this...
>
> a
>      aa
>      ab
>      ac
>          aca
> b
>      ba
>
> ... and photo 1 has tag 'aca' set, I currently have tags 'a', 'ac' and
> 'aca' showing against the photo either in the tool tip or under the
> thumbnail. I have seen that after removing 'a' and 'ac', the photo still
> shows up in a search for either of these tags, because 'aca' is a
> descendent. So I'd like to remove 'a' and 'ac' from photo 1 to remove
> clutter when the tags are listed.
>
> Obviously I can remove these one by one, but am wondering whether
> there's a nice script somewhere to do this on a batch basis?
>
> Thanks

In the left sidebar, you can search for /select images by tag over the whole
collection. Do that for your tag "aca", select all, and in the right side bar
uncheck the tags a and ac. That should do the trick.

It gets a bit unpleasant if you have a very large tag tree, though.