LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-24-2013, 09:54 AM   #1
furryspider
Member
 
Registered: Feb 2004
Location: by the Bavarian Sea
Distribution: Devuan 3 Beowulf
Posts: 74

Rep: Reputation: 18
Digikam: change tag structure hierarchy for existing image collection


Hello,

I've been doing a search for similar topics in several places, but couldn't find an answer to my particular problem. Sorry if this has been asked before.

My situation is this:
I have a collection of photos, some 20000+ pictures. Large portions of these have been tagged, using a tag structure that seemed to make sense at the time. It is important for me to have the metadata not only in the database of my photo management software (Digikam 3.0.0rc1 at present), but also independent of this inside the image files.

What I wish to achieve:
Parts of the tag structure hierarchy have turned out to be too volatile and/or the depicted subject cannot be categorized clearly enough to follow one particular hierarchy branch. I would like to move certain tags around, either under other branches, or just simply up a step or two in the structure hierarchy. Like e.g.:
MyTags/Customers/Firm-A/Division-I/Product-1 ...should become: MyTags/Customers/Firm-A/Product-1
or:
MyTags/People/Family-1/Person-ABC ...should become: MyTags/People/Family-2/Person-ABC

Simpleton that I am, I'd wish that I could just load all my existing image collections in Digikam, move things about in my tag structure, and then have Digikam sync the image metadata with the database, either by writing the metadata to the image, or via "maintenance". That last step however does not seem to work. In my tests, the images retain the old structure hierarchy inside the image files.

What I would like to avoid is having to do a tag search for images, give them a 'temporary marker tag', remove the tag in question, save metadata to images, move tag around, re-assign to those images with the marker tag, remove marker tag, then again save metadata to images. I just have too many tags (and images) for this to be a good workaround.

Any hints how to achieve this 'structure change' would be appreciated. Also, if this isn't the right place for the question, I'd appreciate links to active forums focussing on Digikam, since I wasn't able so far to find much in that area.

Thanks in advance!

(System is Slackware Linux 14.0, KDE 4.9.5 using Digikam 3.0.0rc1.)

Last edited by furryspider; 03-01-2013 at 12:58 PM.
 
Old 03-01-2013, 12:58 PM   #2
furryspider
Member
 
Registered: Feb 2004
Location: by the Bavarian Sea
Distribution: Devuan 3 Beowulf
Posts: 74

Original Poster
Rep: Reputation: 18
In case anybody has similar issues, here's what I did:

First off, it seems like Digikam in its present version is unable to achieve the abovementioned objective. So instead of trying to get Digikam to do something it's apparently no good at, I decided to fiddle around with the very tool that Digikam employs to write metadata to the image files: exiv2

First I checked a lot of my images like so:
Code:
exiv2 pr -p a image.jpg
The metadata keys in question (which store parts of the tag hierarchy) were always these:
Xmp.digiKam.TagsList
Xmp.MicrosoftPhoto.LastKeywordXMP
Xmp.lr.hierarchicalSubject

The last two seem to be keys used by proprietary software (lr meaning "Adobe Lightroom", apparently). Damned if I know why these are written to my pictures at all.

Anyway, outside of Digikam, I mounted all my image collections under one directory and from there cleaned out those keys using this command:
Code:
find . -type f -print0 | xargs -0 exiv2 mo -M "reg lr dummyNameSpace/" -M "del Xmp.lr.hierarchicalSubject" -M "del Xmp.digiKam.TagsList" -M "del Xmp.MicrosoftPhoto.LastKeywordXMP"
This portion...
Code:
-M "reg lr dummyNameSpace/"
...was necessary because without it, exiv2 would complain about the lr-key being invalid and wouldn't touch it.

Then I opened Digikam and moved the tags around to my heart's content. Afterwards, I had it sync the database with the image metadata through 'maintenance'. On my present machine, this process took more than a night to complete, which made the several hours of the earlier exiv2 command look fast as lightning.

The result is pretty much what I wanted.
Since I'm not overly keen on repeating this soon, I guess I'm gonna take great care about my choice of tag hierarchy branches...

Marking this off as solved.
 
  


Reply

Tags
digikam, metadata, photo, tags



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: digiKam Software Collection 2.0.0 beta6 is out... LXer Syndicated Linux News 0 06-08-2011 09:32 PM
LXer: DigiKam - Not really an image editor, but possibly the only one to do what I ne LXer Syndicated Linux News 0 10-23-2009 04:50 AM
PHP: how can I return an image - not the html img src tag, but the image data BrianK Programming 3 05-18-2007 02:28 PM
smb image collection jdier Linux - Newbie 0 05-14-2004 02:47 PM
Desktop hierarchy filesystem: I WANT TO CHANGE IT!! opioid Linux - Software 2 03-28-2004 01:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration