Bug 217735 - Import/export tag hierarchy to/from digikam
Summary: Import/export tag hierarchy to/from digikam
Status: RESOLVED DUPLICATE of bug 258272
Alias: None
Product: digikam
Classification: Applications
Component: Database-Migration (show other bugs)
Version: 1.0.0
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-07 17:51 UTC by bogdan
Modified: 2017-07-26 05:08 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Lightroom Keyword hierarchy (479.79 KB, image/png)
2009-12-07 19:17 UTC, bogdan
Details
The exported keyword hierarchy from Lightroom (252 bytes, text/plain)
2009-12-07 19:22 UTC, bogdan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bogdan 2009-12-07 17:51:54 UTC
Version:           1.0 rc (using KDE 4.3.4)
OS:                Linux
Installed from:    openSUSE RPMs

I would need a way to be able to import/export tag hierarchies. 

For instance I create a tag hierarchy in digikam and I want to send it to a friend to use the same tag hierarchy. 

There are available commercial hierarchy http://www.controlledvocabulary.com/, but ther is none available for digikam and even if it was I don't see a way to import it. 

Please let me know if there is a way. I think this is important for digikam's acceptance. This is one of the features still holding be glued to Ligthroom and therefore to windows.
Comment 1 caulier.gilles 2009-12-07 18:07:22 UTC
What's LR can recognize as tags hierarchy file format ? XML based ?

Gilles Caulier
Comment 2 bogdan 2009-12-07 18:45:31 UTC
I will generate one and send it to you
Comment 3 caulier.gilles 2009-12-07 18:49:48 UTC
Please attach this file to this entry.

Gilles Caulier
Comment 4 bogdan 2009-12-07 19:17:44 UTC
Created attachment 38903 [details]
Lightroom Keyword hierarchy

The right panel has the hierarchy shown in the export file.
Comment 5 bogdan 2009-12-07 19:22:58 UTC
Created attachment 38904 [details]
The exported keyword hierarchy from Lightroom

It looks like LR imports/exports text files. The hierarchy is implemented with <TAB> based branches. Each root of a hierarchy starts from column 0, subsequent lines are tab delimited and the number of tabs is marking the depth in the hierarchy.

I guess we can support this in digikam and also add some XML based tag files. Also please look at the website link from the original post. They sell keywords for multiple applications
Comment 6 bogdan 2009-12-07 19:53:52 UTC
I want to add also that there is a Metadata menu item, which has as sub-menus "Import Keywords" and "Export Keywords".  The imported tags are added to the LR keyword hierarchy and can be used to tag pictures or sets of pictures.

Also there are "Synchronize" & "Synchronize Metadata" buttons,  which can apply to all the changes, tags, keywords , etc to the selected pictures. 

That is really a nice feature to have. Maybe I should open another wish feature bug. That will also make obsolete a lot of other requests on the wishlist.
Comment 7 bogdan 2009-12-07 22:56:29 UTC
Apparently the tags are stored in XMP and not in IPTC.
This is important when exporting to Flicker or Picassa
Comment 8 bogdan 2009-12-16 22:16:56 UTC
Any intention of implementing this? I could help if needed.
Comment 9 caulier.gilles 2009-12-16 23:10:20 UTC
I will review this entry after that digiKam 1.0.0 will be released (20 december)

For the moment we are busy to finalize and stabilize code.

Gilles Caulier
Comment 10 terri.bugs 2010-05-29 16:33:34 UTC
I have imported tag hierarchies by applying them to images in one program and then simply adding those images to my digikam collection. It's not pretty, but it works as long as you don't have too many tags assigned to a single image (field size is limited to 65k in XMP and that's including tags and XMP markup). 700-1200 tags per image is fine depending on how long the tags are.

The same works also the other way around. Apply your tags (or hierarchy) in digikam and then add the image to your collection somewhere else or just read the keywords off the image. You can use exiv2 or exiftool (easier) to read the keywords from image to text file.

However, I would _definately_ want digikam to have the ability to import and export keyword hierarchies directly as many other applications do.
Comment 11 caulier.gilles 2010-05-29 23:10:35 UTC
64k is only true for JPEG... 
PNG TIFF have no limit.

Note : Adobe use more than one JPEG section to host XMP, so more than 64K.
There is also the way to use XMP sidecar file. In this case, there is no size limit.

Gilles Caulier
Comment 12 terri.bugs 2010-05-30 10:53:12 UTC
I said to limit the tag number because digikam does not seem to read more than 700-1100 tags per image correctly. At least version 1.0 (or similar) didn't when I imported tags from Adobe. If more tags were added to a image digikam messed the hierarchy up, lost some keywords even if two other apps showed them correctly or  hang unresponsively. Perhaps things have changed since then, I don't know.
Comment 13 caulier.gilles 2010-05-30 10:57:35 UTC
Before, digiKam used IPTC to import/export tags hierarchies. IPTC has severals limitations (strings size, ASCII only).
Now we use XMP instead. There is no limitation there. UTF8 is used there. digiKam use a dedicated XMP namespace to host hierarchies. stand alone keywords are hosted in another place in XMP and also IPTC.

Gilles Caulier
Comment 14 althio.forum 2010-09-06 17:09:10 UTC
*** This bug has been confirmed by popular vote. ***
Comment 15 Vincent Tassy 2012-05-24 10:15:02 UTC
Trying to revive this WISH as we're now in 2.6 ....

While I'm not interested in exporting to Lightrroom or another 3rd party product, I'm more interested in importing/exporting the tag hierarchy between digikam installs !

I think it's becoming a common scenario that people have a digikam install on a beefy computer at home but also have an install on a laptop or like in my case on a netbook and I wish I could do some of the DAM work on the go but still have the same tag hierarchy that is available on the home PC.

So maybe a simple import/export to a digikam proprietary XML file would suffice.

I'm concious of the implications regarding the integrity of the DB if one were to delete a tag on a PC and then import on another ... but I still think it's an interesting feature to support mobility.
Comment 16 julien.t43+kde 2012-07-07 01:46:09 UTC
It's possible to extract tags with exiftool (like 'exiftool -T -r -Keywords <dir>') but you will loose hierarchy and not possible to import them back in digikam (outside of the ones imported from images). 
For me, there was some time, where I couldn't use digikam and want to use it somewhere else but without import/export, had to do it the manual way ...
Comment 17 caulier.gilles 2012-07-07 05:16:00 UTC
Tags hierarchy is stored in digiKam XMP namespace and can be extracted without to loss any information (and restored) using Exiftools...

http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/XMP.html#digiKam

Look TagsList XMP tag...

Gilles Caulier
Comment 18 julien.t43+kde 2012-07-07 23:15:30 UTC
ok. for used tags:
$ exiftool -T -tagslist -keywords ~/Images/20120607/*JPG |grep -v '^-$'
got them.
One comment, if tags is at root (without parent), tagslist is empty (at least in my case). else tagslist keeps the parent hierarchy of the tag unlike keywords.

Still you have to do it on whole collection. can't harmonize tags list available between multiple (new) digikam installation or with other softwares.

Advanced alternative would be sql query on digikam.db
sqlite> SELECT * FROM Tags LIMIT 10;
but I don't understand the difference between Tags and TagsTree as id/pid is present in both.
A usable output can be done with
sqlite> SELECT t2.name as parent,t1.name as name FROM Tags t1,Tags t2 WHERE t1.pid!=0 AND t2.id==t1.pid LIMIT 10;
Comment 19 caulier.gilles 2014-08-07 07:09:41 UTC

*** This bug has been marked as a duplicate of bug 258272 ***