Bug 158437

Summary: Assign / create Tags or Labels to pictures while importing
Product: [Applications] digikam Reporter: Viesturs Zarins <viesturs.zarins>
Component: Import-PostProcessingAssignee: Digikam Developers <digikam-bugs-null>
Status: REPORTED ---    
Severity: wishlist CC: caulier.gilles, marcel.wiesweg, sylvainsjc, wazery
Priority: NOR    
Version: 3.0.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Viesturs Zarins 2008-02-26 08:35:39 UTC
Version:            (using Devel)
Installed from:    Compiled sources

I would like to add cetrain tags to all pictures imported in one go.
For example "Pictures to be reviewed", "Holidays", "Send these to friends".
Maybe even - "Imported from Freds camera".

I tend to import all pictures into auto created date based albums and hunting down every picture, especially if there are overlapping pictures from other cameras can quite frustrating.

Last time i checked F-spot has a feature to add a single tag while importing pictures, but it would be way more useful to just add a tag cloud that covers all pics in one go.
Comment 1 caulier.gilles 2008-02-26 08:39:36 UTC
Viesturs,

I'm totoally agree. Assigning Tags during import (from camera for ex.) is fine.

Marcel, I propose to do it for KDE4. Fine for you ?

Gilles
Comment 2 FiNeX 2008-02-26 10:31:34 UTC
I like this idea too!
Comment 3 Mikolaj Machowski 2008-02-26 19:12:28 UTC
IMO this should be *totally* extended with possibility of assigning
whole profiles of metadata: tags, comments, copyrights, etc.
Comment 4 FiNeX 2008-02-26 22:17:57 UTC
Yes, it should be.
Comment 5 Mikolaj Machowski 2008-12-06 18:51:44 UTC
IMO this is related to

http://bugs.kde.org/show_bug.cgi?id=139361
Comment 6 Viesturs Zarins 2008-12-09 08:14:59 UTC
>> IMO this is related to http://bugs.kde.org/show_bug.cgi?id=139361 

It may be and may be not. The interface should allow very simple addition of tags specific to pictures being imported. Preferably just by typing in comma separated strings (with autocomplete).
Comment 7 Andi Clemens 2009-09-02 10:24:35 UTC
What about this entry? I think we could use the TagFolderCombobox for this (like in FindDuplicates) to add keywords to imported images.
F-Spot has something like this, too. When you import images, they all get an "imported" tag assigned to them. All imported tags from the images are subtags of "imported". I think this is very useful.
For example when I get images from a friend who has tagged his photos, but I don't like the tags he used, I need to manually remove "thousands" of tags by hand after import.
If we have an "imported" tag and all the foreign tags are subtags of it, you can simply remove "imported" and the thousands of unwanted tags are gone, too.

So actually I guess we need two features here:
1. Assign any existing tags from the digiKam database while importing
2. Create an (optional) "imported" tag with foreign tags as subtags of it

Andi
Comment 8 caulier.gilles 2009-09-02 10:39:45 UTC
Andi,

I'm agree to use TagFolderCombobox in camergui. it sound a cool feature.

Warning : you cannot apply tag during donwloading because it use separate thread and you cannot access to DB at this moment. You must delay this task just after, outside thread.

For me both features to implement are fine.

Gilles Caulier
Comment 9 Marcel Wiesweg 2009-09-02 18:41:58 UTC
> Warning : you cannot apply tag during donwloading because it use separate
> thread and you cannot access to DB at this moment. You must delay this task
> just after, outside thread.

If you copy the file it is not in the db immediately, you have to wait for the collection scanner to catch up. In CameraUI::finishDialog() we trigger the collection scanner explicitly, but even this is asynchronous. It's a bit difficult. A possible technique is what we do in ScanController::recordHints() for copy+move operations.
Comment 10 caulier.gilles 2011-08-10 14:11:33 UTC
Marcel,

There is a simpler possiblilty to tag image at import : why not to create the tag in digiKam XMP namespace. I can be done in camera controller thread. The tags will be automatically assigned by ScanController. 

Right ?

Gilles Caulier
Comment 11 caulier.gilles 2011-08-10 14:13:11 UTC
Andi,

Do you want to implement this feature in current git master, using TagFolderCombobox to assign tags in CameraGui ?

Gilles Caulier
Comment 12 caulier.gilles 2011-08-11 18:01:20 UTC
Marcel, 

nevermind. My solution from #10 don't work with read only files...

Implementing support of tagging feature in GUI is easy. recording items in DB is more difficult.

Instead ScanController::recordHints() as you said in #9, which do not exist, do you mean :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/database/collectionscanner.cpp#L180

Gilles Caulier
Comment 13 Marcel Wiesweg 2011-08-11 19:12:03 UTC
Thinking about this again, I dont like my idea all too much.
What we'd need is some object which knows about tags to apply to images, and applies them as soon as the item appear. Assuming we copy to a single album, it could be an ImageAlbumModel so all database interfacing is already done for us. It could also be a custom class which listens to database signals and as soon as it sees an item added, add the tag. For adding the tag, MetadataManager is available.
Comment 14 Islam Wazery 2012-09-05 00:22:03 UTC
Git commit 191aaac539b69e90747d8c6efd46a92a2f5415e1 by Islam Wazery.
Committed on 05/09/2012 at 02:18.
Pushed by wazery into branch 'master'.

Added pre-color labels, pre-pick labels, and pre-tags
I implemented settings the tags in gui, but the remaining thing is to add them to downloaded items.
Please have a look in the cameracontroller.cpp:627

M  +8    -0    utilities/importui/backend/cameracontroller.cpp
M  +22   -2    utilities/importui/backend/camiteminfo.cpp
M  +6    -0    utilities/importui/backend/camiteminfo.h
M  +20   -11   utilities/importui/backend/downloadsettings.h
M  +19   -22   utilities/importui/items/importdelegate.cpp
M  +1    -1    utilities/importui/items/importdelegate.h
M  +2    -2    utilities/importui/items/importdelegatepriv.h
M  +50   -0    utilities/importui/items/itemviewimportdelegate.cpp
M  +3    -0    utilities/importui/items/itemviewimportdelegate.h
M  +68   -17   utilities/importui/views/importiconview.cpp
M  +10   -0    utilities/importui/views/importiconview.h
M  +6    -10   utilities/importui/views/importpreviewview.cpp
M  +3    -0    utilities/importui/views/importpreviewview.h
M  +15   -15   utilities/importui/views/importsettings.cpp
M  +2    -2    utilities/importui/views/importsettings.h
M  +7    -1    utilities/importui/views/importstackedview.cpp
M  +30   -18   utilities/importui/widgets/importcontextmenu.cpp
M  +21   -4    utilities/importui/widgets/importcontextmenu.h

http://commits.kde.org/digikam/191aaac539b69e90747d8c6efd46a92a2f5415e1
Comment 15 caulier.gilles 2012-09-05 11:14:38 UTC
Islam,

Looking your code in camera controller line 627, i can see that only JPEG image imported will be tagged/labelled.

Also you use DMetadata. Its fine for R/W metadata file fomat, but for other as RAW ? Alternative is to use XMP sidecar, which is universal, and in this case you must :

1/ create relevant sidecar before import in DB. DMetadata will do it for you.
2/ Switch on temporally DB scanner settings to handle XMP sidecars (user can not use this option in setup panel).
3/ switch off XMP sidecar handling with DB after import is complete.

Gilles Caulier
Comment 16 Islam Wazery 2012-09-05 12:46:25 UTC
Gilles, I am not sure I can handle it, can you please do it instead of me?
Comment 17 caulier.gilles 2012-09-05 13:29:51 UTC
Ok, i will take a look.

Gilles
Comment 18 caulier.gilles 2012-09-05 13:31:24 UTC
Marcel,

Take a look in my proposal from comment #15. It sound fine for you ? Or do you know a more easy way to do it ?

Gilles Caulier
Comment 19 Marcel Wiesweg 2012-09-05 19:36:40 UTC
Can work, but looks a bit like a hack ;-)
Clean solution: Store a list of properties to be assigned, and when a new image appears, the relevant file manager actions are started.
We would need to find the right place for this to happen.
Comment 20 Islam Wazery 2012-10-04 12:05:18 UTC
Gilles, What is the status about this bug?, can we close it now or there are something remaining in the implementation?
Comment 21 caulier.gilles 2012-10-04 12:10:55 UTC
Accordingly with #15 to #19, something is missing to be able to apply digiKam Labels to all image type, not only JPEG. If we close this file, i'm sure to see another one open by end user in the future.

I don't have take a look to the implementation as Marcel said in #19.

Gilles Caulier