Bug 152424 - Workflow organizing : use Color Label Tags over icon view items
Summary: Workflow organizing : use Color Label Tags over icon view items
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Colors (show other bugs)
Version: 2.0.0
Platform: Mandrake RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-16 15:12 UTC by drewbrewit
Modified: 2017-07-29 09:58 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.0.0


Attachments
Icon view from Adobe Bridge using Color Label Tagging (359.71 KB, image/jpeg)
2007-11-22 10:16 UTC, caulier.gilles
Details
How FS does color labels. (571.68 KB, image/png)
2009-06-02 11:36 UTC, Mikolaj Machowski
Details
How IMatch does labels/rating (286.19 KB, image/png)
2009-06-02 13:10 UTC, Mikolaj Machowski
Details
First implementation to manage Color Label in Database (40.24 KB, patch)
2011-01-31 17:45 UTC, caulier.gilles
Details
moc-up for Advanced Search tool with Color Labels. (130.24 KB, image/png)
2011-02-10 16:20 UTC, caulier.gilles
Details
Patch for Advanced Search tool to support Color Labels. (8.26 KB, patch)
2011-02-11 11:47 UTC, caulier.gilles
Details
Patch for Advanced Search tool to support Color Labels. (8.26 KB, patch)
2011-02-11 12:19 UTC, caulier.gilles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description drewbrewit 2007-11-16 15:12:53 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    Mandrake RPMs
OS:                Linux

Some possible additions to make Digikam more useful to photographers who workflow lots of pictures:

1: Color coding images: allow user to color code images so that he/she can organize images according to workflow. So, for example, an image colored as Blue might mean "edit in GIMP", whereas an image colored Green might mean "send to Web", etc. The color coding does not describe the colors in the image but rather is the color of some indicator (icon, bar, etc.) next to the image that lets the user quickly see what needs to be done to an image and how.

2: Flag: allow user to flag an image in one of three states: Keeper, reject or no flag (default). This provides an easy mechanism to quick find the "keepers" from a shoot of TONS of images.

3: Transparent histogram over image in light table: provide a way for user to view histogram for all images on light table so he/she can pick the best image.

Also, make 1 & 2 above in light table as well.
Comment 1 Mikolaj Machowski 2007-11-16 21:13:36 UTC
> 1: Color coding images: allow user to color code images so that he/she
> 2: Flag: allow user to flag an image in one of three states: Keeper,
> 3: Transparent histogram over image in light table: provide a way for


1. and 2. are just temporary tags. You can use just normal rating system
for that type of tagging. Sure, nice icons could be nice touch but it is
hardly necessary to do real work. 

I am using this non-stop. With additional shortcuts ` for no-rating and
1 for one star and 2 for two stars. 0 would be logical for no-rating
but in this way I can make rating with one hand and navigate with second
hand on mouse. This is very handy especially with recently introduced
quick filtering by rating in status bar.

Although I am partial to color coding, more visible (and recognizable)
than icons. FotoStation colors images according to Urgency metadata tag.

You can view histogram in Light Table by expanding panels, they are
still there. It is not really useful on 5:4 (or 4:3) screens but should
work OK on panoramic.

digiKam parted with transparent histograms some time ago because... Hmm,
I don't want to make up things but I think there were always problems
with drawing them on canvas.
Comment 2 caulier.gilles 2007-11-16 21:19:35 UTC
Mik,

>digiKam parted with transparent histograms some time ago because... Hmm,
>I don't want to make up things but I think there were always problems
>with drawing them on canvas.

Not only, because it been redundant with the Histogram sidebar tab...

Gilles
Comment 3 Mikolaj Machowski 2007-11-16 21:35:47 UTC
> Not only, because it been redundant with the Histogram sidebar tab...


Of course.
Ad meritum: I think in this scope bug is INVALID. Introducing additional
two ways of tagging when it is  possible to make quick tagging with
existing tools...
Comment 4 Mikolaj Machowski 2007-11-21 21:24:11 UTC
I am repeating: IMO this wish is WONTFIX category. First two things you can make with quick and temporary rating, third existed but was replaced. Without protests in next 24h I will close this entry.
Comment 5 Arnd Baecker 2007-11-21 21:48:32 UTC
Sorry, I forgot to add my 2cents on this:
1.) additional color code is used, I think, by photoshop (bridge?).
    So it might be not that bad. 
    (I remember that I liked it the first time I heard the concept...)

2.) About flagging images: I think that here tags are good enough,
    together with a keyboard short-cuts, 
    see bug 114465
    
3.) > Not only, because it been redundant with the Histogram sidebar tab...
   Well, this takes a lot of space. So the idea of transparant
   histograms is not that bad  (it might be difficult to implement, 
   but maybe with KDE4 things are simpler?)

So I would suggest to actually file to separate wishes for 1.) and 3.),
and let users vote for them.
(Having several wishes in one bug complicates the discussion a bit ...;-)
Comment 6 caulier.gilles 2007-11-21 21:50:26 UTC
Mik,

Point1/ is similar than "Label" feature in LightRoom or Imatch. You tag images with a dediced color box. This is not rating, but can be remplaced with special Tags in digiKam

Note than XMP as a dedicaced Tag for that named... Label. I think we can implement it with KDE4 port where DB schema is changed.

Marcel, Arnd, etc... your viewpoints ?

Gilles

Comment 7 caulier.gilles 2007-11-21 21:51:47 UTC
Mik,

Point3/ is redondant with Sidebar color tab content. This point is INVALID for me.

Gilles
Comment 8 caulier.gilles 2007-11-21 21:53:39 UTC
Mik, 

Point2/ is very similar than Rating. This point is INVALID for me.

Still point1/ where something can be done to have a similar env. than pro soft.

I'm waiting comments from team...

Gilles
Comment 9 Arnd Baecker 2007-11-22 10:03:08 UTC
Gilles, ad #6, i.e. point 1/:  "label" feature, sounds like a good concept to me.
Comment 10 caulier.gilles 2007-11-22 10:16:14 UTC
Created attachment 22158 [details]
Icon view from Adobe Bridge using Color Label Tagging

Marcel, 

Look this Adode Bridge screenshot provided by Stephano Rivoir about Color Label
Tagging feature. It's simple to use. 

What do you think about ?

Gilles
Comment 11 Marcel Wiesweg 2007-11-22 16:45:08 UTC
Well, it's ok, I dont object.
We can use tags to implement it, then it is also simple to implement. The icon view can display a color of a certain tag is assigned. Plus some UI for assigning colors. And some special handling for displaying the tag in some tag views.
Comment 12 Mikolaj Machowski 2007-11-22 20:36:32 UTC
> 10:16 ------- Created an attachment (id=22158)
>  --> (http://bugs.kde.org/attachment.cgi?id=22158&action=view)
> Icon view from Adobe Bridge using Color Label Tagging


That's very similar to FotoStation. In FS photo plates have small menu
embedded with choice of colors. There is also additional filtering
option for that. Note however that FS, and probably Bridge, don't have
digiKam rating system. This is just another type of implementation.
Comment 13 Arnd Baecker 2007-11-22 20:52:28 UTC
According to Scott Kelby's "the photoshop CS2 book for digitial photographers"
the bridge has both ratings and color labels.
See http://bugs.kde.org/show_bug.cgi?id=134206#c7 for a more detailed discussion.
Comment 14 Mikolaj Machowski 2007-11-26 23:56:51 UTC
Yes. You are  right. Bridge has colors AND stars. It creates 25 levels
of rating or two separate categories of rating. Interesting visual
solution. Lengthened oval below photo with stars on it

 Photo
 _______
/       \
| ***** |
\_______/

Text,date
Comment 15 caulier.gilles 2009-06-01 21:21:21 UTC
*** Bug 139465 has been marked as a duplicate of this bug. ***
Comment 16 caulier.gilles 2009-06-01 21:28:32 UTC
Marcel, i'm back with Color Label Tags.

This feature is another candidate for icon-view item overlay. It's eady to implement this part.

In second, of course, database schema need to be increased (or it's already implemented ?)

In 3rd, we need to be able to change Colors Label Tags on item using :
- pop-up context menu (Andi you viewpoint here)
- right side bar Caption & Tags tab

Question : Which Colors to use ? I propose 3 :

- Green : item is good in my workflow.
- Yellow (or Orange ?) : item is medium. I'm not yet sure if i will use it.
- Red : item is a good candidate to be delete.

Your viewpoints ?

Gilles Caulier
Comment 17 Mikolaj Machowski 2009-06-02 00:13:07 UTC
3 is bit low for fine grain of workflow.

FotoStation uses 10 (and calls it priority): None, White (Low), Purple (High), Red, Orange, Yellow, Green (Normal), LightBlue, Blue, Black.

Adobe Bridge uses 5: Red (Select), Yellow (Second), Green (Approved), Blue (Review), Violet (To-Do) (probably over-engineering but interesting thing - you can define different sets of colors).

Adobe uses Ctrl-6..9 for color labels.

IMatch follows Adobe standard. Ah, according to this page (IMatch Wiki):
http://wiki.photoolsweb.com/index.php?title=Labels_and_Ratings
Colors are named: Red, Yellow, Green, Cyan, Purple. Names of labels and colors are customizable.

IMatch uses Ctrl-1..5 for rating, and Ctrl-Shift-1..5 for labels
Comment 18 caulier.gilles 2009-06-02 09:15:50 UTC
Thanks Mik for this very important resume.

I vote to follow Adobe Bridge way, but i'm not sure if to provide configuration of colors set really mandatory

I'm waiting Marcel and Andi viewpoint now, to continue...

Gilles
Comment 19 caulier.gilles 2009-06-02 09:20:48 UTC
Mik, 

If i have understand your comment #14, color tag is set to background of Rating widget. Right ? I think it's can be a good solution.

Else, where we can put Tag Color widget in icon-view item ? below caption and tags informations ? In this case this will increase item size again and it's not the best way tp optimize icon view layout.

Gilles
Comment 20 Mikolaj Machowski 2009-06-02 11:35:51 UTC
In attachment are screens with explanations how FotoStation does this.

From available screenshots/descriptions looks like Adobe Bridge interface is better but I don't have access to it :)

One thing which isn't clear from screenshot: in FS name/date area isn't clickable (click does nothing) only plate above has some actions.
Comment 21 Mikolaj Machowski 2009-06-02 11:36:43 UTC
Created attachment 34187 [details]
How FS does color labels.
Comment 22 caulier.gilles 2009-06-02 11:51:10 UTC
Marcel,

Look last screenshot from Mik. this feature rock really for pro-photograph. I like this.

Gilles
Comment 23 Mikolaj Machowski 2009-06-02 12:34:14 UTC
I am now preparing screenshot from IMatch so wait a minute ;) This program is a bit more like Adobe Bridge.

One thing I like FS is handling of star rating: additional red cross to remove rating is easier to use + animation for moving stars when hovering is slower than in digiKam - just looks better.
Comment 24 Mikolaj Machowski 2009-06-02 13:10:49 UTC
Created attachment 34191 [details]
How IMatch does labels/rating
Comment 25 Julien Narboux 2009-06-02 13:31:36 UTC
Lightroom color labels:

http://www.aurora.is/using_colorlabels_in_adobe_lightroom_workflow

IMHO solution proposed in #14 : background color of rating is the nicest.

Julien
Comment 26 Mikolaj Machowski 2009-06-02 14:00:14 UTC
Another link with various overlay icons in Lightroom. Personally I like LR solution the least - small, barely visible rectangle on the right of stars:

http://www.peachpit.com/articles/article.aspx?p=1233193

In this short PDF you have screenshots from Adobe Bridge:

http://www.geocompa.com/BridgeWorkflow.pdf

Quality isn't good but you see:
Page 1: stars alone
Page 2: label alone
Page 4: label + dots appearing when image is selected, ready to become stars

Note: label bar is quite high in pixels, here looks small because thumbnails are huge.
Comment 27 Mikolaj Machowski 2009-06-02 17:05:05 UTC
@18 - Gilles - while configuration for various sets of names/colors is overkill possibility to change "names" of colors would be good (and this particular feature have all described programs).
Comment 28 Mikolaj Machowski 2009-08-01 23:04:44 UTC
*** Bug 202193 has been marked as a duplicate of this bug. ***
Comment 29 caulier.gilles 2009-10-22 08:49:34 UTC
The plan to add Color LAbel support to digikam is listed below :

1/ Add field in database for each items.
2/ Add a wrapper in database interface to patch ImageInfo
3/ Add an overlay to iconview to display and change color label with mouse
4/ Patch Captions and Tags sidebar to provide a way to display and change color label.
5/ Patch item tooltips to show color label.
6/ Patch DMetadata to save/load color label into/from XMP.
7/ Collection scanner must be able to parse XMP metadata using DMetadata and record Color label properties in database.
8/ Patch Setup everywhere when it's necessary : Collection view, tooltips, Metadata.

Gilles Caulier
Comment 30 caulier.gilles 2011-01-19 11:04:09 UTC
Marcel, 

Can we patch digiKam 2.0 DB to support Color Label Tags for album items ?

What's the best way : create a new table named "ImageColorLabels" as "ImageTags" table ?

This is how Adobe Aperture manage Color Label Tags :

http://aperture.maccreate.com/2010/02/15/flagging-and-labeling-photos-video-and-audio-in-aperture-3/

...look how many colors label are available :

http://aperture.maccreate.com/files/2010/02/media_1256598835770.png

Gilles Caulier
Comment 31 Marcel Wiesweg 2011-01-20 14:09:15 UTC
I suggest to use the normal tags table, but handle these tags in a special way in a few situations. A new table would result in huge code duplication.

Have a look at the TagProperties class in libs/database. You can assign any property to a tag, such as marking it as a Person tag, or a Color tag.
(this also applies to the keyboard shortcuts #114465 and comments #149372).
There can be one value or multiple values per keyword. Have a look at libs/database/databaseconstants.h for defined TagProperties.

In the specific case here, we'd need to patch the delegate that it does not draw the textual label for a color tag, but the relevant color, and add the UI to add a label. 

We need to decide if we want to present these "special" tags alongside the normal tags in the tag sidebar. In this case, it would be easy for the user to see all images with a given color, but it also exposes an implementation detail. If we dont want to show, you can also choose to create these tags as internal tags (see TagsCache), in this case they will everywhere be invisible to the user, and only accessible through specific UI.
Comment 32 caulier.gilles 2011-01-20 15:01:15 UTC
>I suggest to use the normal tags table, but handle these tags in a special way
>in a few situations. A new table would result in huge code duplication.

ok. Fine for me.

>Have a look at the TagProperties class in libs/database. You can assign any
>property to a tag, such as marking it as a Person tag, or a Color tag.
>(this also applies to the keyboard shortcuts #114465 and comments #149372).

Excelent ! This is exactly what's i need.

Note : i plan also to create a new dialog to edit tags hierarchy and properties, something like Firefox bookmark edit dialog.

>There can be one value or multiple values per keyword. Have a look at
>libs/database/databaseconstants.h for defined TagProperties.

ok

>In the specific case here, we'd need to patch the delegate that it does not
>draw the textual label for a color tag, but the relevant color, and add the UI
>to add a label. 

Ok. and me, i plan to patch Captions & Tags view from right sidebar bar to support Color tags.

>We need to decide if we want to present these "special" tags alongside the
>normal tags in the tag sidebar. In this case, it would be easy for the user to
>see all images with a given color, but it also exposes an implementation
>detail. If we dont want to show, you can also choose to create these tags as
>internal tags (see TagsCache), in this case they will everywhere be invisible
>to the user, and only accessible through specific UI.

I vote to show color tags as rating edit tool, as an horizontal widget in this sidebar tab.

There are also other views to patch :

- All contextual menu.
- Tags filter view on right side.
- Tags view on left side. For this one, perhaps it's better to add a new view dedicated to show all items by rating (there is en entry in bugzilla about, it's a missing feature) or by color tags. I don't know yet.

Gilles
Comment 33 caulier.gilles 2011-01-26 20:35:56 UTC
Marcel, 

I take a look about how Adobe Aperture handle Color Labels in icon view. Look my screenshoot :

http://www.flickr.com/photos/digikam/5390466875/

Look like color label are use as color background of filename. I propose to do the same with icon item color background, or to set just a small icon on a corner with the right color.

Note that i cannot see any change about color label information in image metadata. Very strange...

Color available are not customizable. All have shortcut assigned :

None : CMD+Á
Red : CMD+&
Orange : CMD+È
Yellow : CMD+" 
Green : CMD+'
Blue : CMD+(
Violet : CMD+$
Gray : CMD+E

For me these shortcut are completely stupid and unsuitable. This is my proposal :

None : ALT+0
Red : ALT+1
Orange : ALT+2
Yellow : ALT+3 
Green : ALT+4
Blue : ALT+5
Violet : ALT+6
Gray : ALT+7

This do not in conflict with rating shortcuts which are : CTRL+0/1/2/3/4/5

What do you think about ?

Gilles Caulier
Comment 34 Marcel Wiesweg 2011-01-26 22:31:06 UTC
I have no strong opinion about the shortcuts, sounds fine for me, and is symmetric to rating. (what about giving order to colors? Traffic light? None - Green - Yellow - Orange - Red - Blue - Violet - Gray?)

Painting in the icon view can easily be customized in ItemViewImageDelegate (implementing a drawColorLabel() method) and ImageDelegate (for calling the drawColorLabel() method)
Comment 35 caulier.gilles 2011-01-27 09:04:40 UTC
Justr for info : Adobe LightRoom use this tag :

http://www.lightroomforums.net/showthread.php?2575-Can-Lightroom-import-color-label-in-.xmp

From this post it talk about "xap" XMP schema, which is renamed now "xmp", as it's explained into Exiftool database :

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

In Exiv2 we have also this tag referenced :

"Label 	Label 	Text 	XmpText 	External 	A word or short phrase that identifies a document as a member of a user-defined collection. Used to organize documents in a file browser."

So, we have a standard place to store this information in file metadata.

I will try LightRoom to see which way are used to manage Color Label in GUI.

Note : It's fun to see that Adobe application are not able to share this information from image metatada :

http://forums.adobe.com/message/2826278

... because string in this XMP tag is internationalized... Sometime i think that Adobe developers are completely stupid... (:=)))

Gilles Caulier
Comment 36 caulier.gilles 2011-01-27 09:18:48 UTC
Marcel,

About color, Adobe Aperture use rainbows 7 colors defined by Isac Newton :

http://en.wikipedia.org/wiki/Roy_G._Biv

None : ALT+0

Red : ALT+1
Orange : ALT+2
Yellow : ALT+3 
Green : ALT+4
Blue : ALT+5
Violet : ALT+6

Gray : ALT+7

But without Indigo and plus Gray. I can understand why Indigo is not there : because it's difficult to differentiate with violet.

For me, it miss 2 colors here : Black and White 

So i propose to use the same schema that Aperture but extended to support whole numerical keys as shortcuts :

None :   ALT+0
Red :    ALT+1
Orange : ALT+2
Yellow : ALT+3 
Green :  ALT+4
Blue :   ALT+5
Violet : ALT+6
Gray :   ALT+7
Black :  ALT+8
White :  ALT+9

My question now, it to deal these tag in database. If we want to see these tags immediately somewhere in GUI (tag filter, tags tree view, etc...), they must be hard-coded somewhere to patch DB file. Right ? Or you see a better way in mind ?

Gilles Caulier
Comment 37 Marcel Wiesweg 2011-01-27 14:07:28 UTC
Yes, something like this must be done.
If you want the tags to be hidden and only visible through specific GUI, define the names in InternalTagName, and use getOrCreateInternalTag().
These calls must then be done at application startup.

If you want the tags to be publicly visible, the first approach would be to add the common Color parent tag and the color tag's names to databaseconstants.h, for example in a class ColorTagName, and call TagsCache's getOrCreateTags where you need them.
There is a problem now: The tag names must be i18n'ed if they are visible. If the system language changes, suddenly they cannot be found anymore.
So there is a better approach for this case: Create the tag with a property. The property is the color, in English, and never changes. The user can rename the tag, it is still identified.

To find the tags:
TagsCache::instance()->tagsWithProperty(TagPropertyName::colorTag()); // gets all color tags. Can also request a specific value.
To create tags: 
TagsCache::instance()->getOrCreateTagWithProperty(colorTagsParentPath + i18n("Red"), TagPropertyName::colorTag(), TagPropertyValue::redColor());
Comment 38 caulier.gilles 2011-01-27 14:29:04 UTC
Marcel,

For me the tags name must be cached from the gui. The only view of this must be colored widget/background.

Gilles Caulier
Comment 39 caulier.gilles 2011-01-27 16:58:24 UTC
Marcel,

Look how Adobe LightRoom handle Color Label. for me it's completly dumy and uncomplete :

http://www.flickr.com/photos/digikam/5392704489/sizes/o/

Look on thumbbar, the very small border in Red around icon item.
Look which color are available in context menu, without a visual color as well.
Look on the right sidebar, on metadata panel, the text field associed to Color Label. Just over look Rating information which is displayed with star widget, not by text.

We can do better, i'm sure...

Note : I hate LR interface, but there are few great filters options available. But usability is really destroyed by this very bloated interface. All in the same Window...

Gilles Caulier
Comment 40 Marcel Wiesweg 2011-01-27 17:06:02 UTC
> For me the tags name must be cached from the gui. The only view of this must 
> be colored widget/background.

All right, then only add the tag names to InternalTagName, and use TagsCache::instance()->getOrCreateInternalTag() ensure the tags are present. It's the easiest solution. The tags will not be visible in any tags tree or tooltip, but programmatically, you can assign etc. just like any other tag.

> Look on thumbbar, the very small border in Red around icon item.
> Look which color are available in context menu, without a visual color as 
> well.
> We can do better, i'm sure...

Yes I'm sure ;-) A simple color widget in a QWidgetAction for the menu, drawing the color with the delegate clearly visible, as well in the side bar. Not too difficult.
Comment 41 caulier.gilles 2011-01-27 17:09:51 UTC
Marcel,

Look how M$ Expression Studio handle Color Label :

http://msdn.microsoft.com/en-us/library/cc294858.aspx

see on icon view how is displayed color label on the same horizontal line than rating widget.

Look also which keyboard shortcuts are used for color label. Look also the color order...

Gilles Caulier
Comment 42 caulier.gilles 2011-01-28 14:41:53 UTC
Marcel,

The first widget to select color label is done :

http://www.flickr.com/photos/digikam/5395680694/sizes/o/in/photostream/

This bar will no be displayed as well in Caption & Tags Sidebar. I plan to use a lead button with a pop-up menu attached which will display this tool bar.

Look like i use colors from Adobe Aperture, which are less aggressive than pure red/green/blue, etc...

Gilles Caulier
Comment 43 caulier.gilles 2011-01-29 12:25:35 UTC
Marcel,

New version of color label selector widget in Caption & Tags. I hope that you like it (:=)))

http://www.flickr.com/photos/digikam/5397310319/sizes/o/in/photostream/

Gilles Caulier
Comment 44 caulier.gilles 2011-01-31 14:07:55 UTC
SVN commit 1218115 by cgilles:

register internal color label tags name
CCBUGS: 152424


 M  +54 -0     databaseconstants.cpp  
 M  +25 -0     databaseconstants.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218115
Comment 45 caulier.gilles 2011-01-31 14:50:43 UTC
SVN commit 1218118 by cgilles:

Color Label wrapper in tag action manager.
Action are created and managed from this class.
Color Label Tags are created in Database from this class.
Action event are ot yet dispatched at the right place in GUI.
CCBUGS: 152424


 M  +105 -6    tagsactionmngr.cpp  
 M  +4 -0      tagsactionmngr.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218118
Comment 46 caulier.gilles 2011-01-31 17:45:48 UTC
Created attachment 56697 [details]
First implementation to manage Color Label in Database

Marcel, 

This patch is a first try to manage color label in database.

In GUI, for the moment, only Captions & Tags view is patched.

Implementation to review indeep are : 

- metadatahub : CL are managed has Rating. I think all is fine here.
- imageinfo : in this class, the way to read and record color label exclusive value are not so far optimal.
- dmetadata : Color label are for the moment saved in XMP digiKam namespace as a color ID. Values are declared now in globals.h. There is no option yet in metadata settings panel to turn on/off writing of this info in image. For the moment, to hack , it's turned on.

TODO :

- Add an option in metadata settings panel.
- Apply Color Label to icon-view items, as color background (for ex.).
- Add an option in context menu to change color label.
- Add an option to filter icon-view.
- Add an option in Advanced Search tool.
- Patch DB to handle Color Label from metadata (ImageScanner)

What's else ?

Gilles Caulier
Comment 47 caulier.gilles 2011-02-01 08:49:05 UTC
SVN commit 1218197 by cgilles:

2 new methods to handle Color Label information from digiKam XMP namespace


 M  +56 -2     dmetadata.cpp
 M  +5 -2      dmetadata.h


--- branches/extragear/graphics/digikam/core/libs/dmetadata/dmetadata.cpp #1218196:1218197
@@ -6,8 +6,8 @@
 * Date        : 2006-02-23
 * Description : image metadata interface
 *
- * Copyright (C) 2006-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
- * Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Copyright (C) 2006-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
@@ -358,6 +358,32 @@
    return true;
 }

+int DMetadata::getImageColorLabel() const
+{
+    if (getFilePath().isEmpty())
+    {
+        return -1;
+    }
+
+    if (hasXmp())
+    {
+        QString value = getXmpTagString("Xmp.digiKam.ColorLabel", false);
+
+        if (!value.isEmpty())
+        {
+            bool ok      = false;
+            long colorId = value.toLong(&ok);
+
+            if (ok && colorId >= NoneLabel && colorId <= WhiteLabel)
+            {
+                return colorId;
+            }
+        }
+    }
+
+    return -1;
+}
+
 int DMetadata::getImageRating() const
 {
    if (getFilePath().isEmpty())
@@ -500,6 +526,34 @@
    return -1;
 }

+bool DMetadata::setImageColorLabel(int colorId) const
+{
+    if (colorId < NoneLabel || colorId > WhiteLabel)
+    {
+        kDebug() << "Color Label value to write is out of range!";
+        return false;
+    }
+
+    kDebug() << getFilePath() << " ==> Color Label: " << colorId;
+
+    if (!setProgramId())
+    {
+        return false;
+    }
+
+    // Set standard XMP rating tag.
+
+    if (supportXmp())
+    {
+        if (!setXmpTagString("Xmp.digiKam.ColorLabel", QString::number(colorId)))
+        {
+            return false;
+        }
+    }
+
+    return true;
+}
+
 bool DMetadata::setImageRating(int rating) const
 {
    // NOTE : with digiKam 0.9.x, we have used IPTC Urgency to store Rating.
--- branches/extragear/graphics/digikam/core/libs/dmetadata/dmetadata.h #1218196:1218197
@@ -6,8 +6,8 @@
 * Date        : 2006-02-23
 * Description : image metadata interface
 *
- * Copyright (C) 2006-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
- * Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Copyright (C) 2006-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
@@ -70,6 +70,9 @@
    CaptionsMap getImageComments() const;
    bool setImageComments(const CaptionsMap& comments) const;

+    int  getImageColorLabel() const;
+    bool setImageColorLabel(int colorId) const;
+
    int  getImageRating() const;
    bool setImageRating(int rating) const;

Répondre
		
Transférer
		
		
Répondre
|
Gilles Caulier
 à kde-commits
	
afficher les détails 08:39 (Il y a 2 minutes)
	
SVN commit 1218198 by cgilles:

new Color Label settings to handle action to do with image metadata


 M  +4 -2      metadatasettingscontainer.cpp
 M  +2 -1      metadatasettingscontainer.h


--- branches/extragear/graphics/digikam/core/libs/dmetadata/metadatasettingscontainer.cpp #1218197:1218198
@@ -6,7 +6,7 @@
 * Date        : 2010-08-20
 * Description : Metadata Settings Container.
 *
- * Copyright (C) 2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * Copyright (C) 2010-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
@@ -27,7 +27,6 @@

 #include <kconfiggroup.h>

-
 // LibKExiv2 includes

 #include <libkexiv2/kexiv2.h>
@@ -47,6 +46,7 @@
    exifSetOrientation    = true;
    saveComments          = false;
    saveDateTime          = false;
+    saveColorLabel        = false;
    saveRating            = false;
    saveTemplate          = false;
    saveTags              = false;
@@ -66,6 +66,7 @@

    saveComments          = group.readEntry("Save EXIF Comments",          false);
    saveDateTime          = group.readEntry("Save Date Time",              false);
+    saveColorLabel        = group.readEntry("Save Color Label",            false);
    saveRating            = group.readEntry("Save Rating",                 false);

    writeRawFiles         = group.readEntry("Write RAW Files",             false);
@@ -84,6 +85,7 @@

    group.writeEntry("Save EXIF Comments",          saveComments);
    group.writeEntry("Save Date Time",              saveDateTime);
+    group.writeEntry("Save Color Label",            saveColorLabel);
    group.writeEntry("Save Rating",                 saveRating);

    group.writeEntry("Write RAW Files",             writeRawFiles);
--- branches/extragear/graphics/digikam/core/libs/dmetadata/metadatasettingscontainer.h #1218197:1218198
@@ -6,7 +6,7 @@
 * Date        : 2010-08-20
 * Description : Metadata Settings Container.
 *
- * Copyright (C) 2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * Copyright (C) 2010-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
@@ -60,6 +60,7 @@

    bool saveComments;
    bool saveDateTime;
+    bool saveColorLabel;
    bool saveRating;

    bool saveTemplate;
Comment 48 caulier.gilles 2011-02-01 08:49:25 UTC
SVN commit 1218199 by cgilles:

new option to manage Color Label in metadata
CCBUGS: 152424


 M  +11 -1     setupmetadata.cpp  
 M  +1 -1      setupmetadata.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218199
Comment 49 caulier.gilles 2011-02-01 09:43:41 UTC
SVN commit 1218200 by cgilles:

TagsCache now create and manage list of ColorLabel tags. Add a new method to get tagID associate to a Color Label ID.


 M  +29 -1     tagscache.cpp
 M  +16 -5     tagscache.h


--- branches/extragear/graphics/digikam/core/libs/database/tagscache.cpp #1218199:1218200
@@ -6,7 +6,8 @@
 * Date        : 2010-04-02
 * Description : Cache for Tag information
 *
- * Copyright (C) 2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Copyright (C) 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Copyright (C) 2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
@@ -29,6 +30,7 @@
 #include <QReadWriteLock>
 #include <QReadLocker>
 #include <QWriteLocker>
+#include <QMap>

 // KDE includes

@@ -77,6 +79,7 @@
    bool                     needUpdateHash;
    bool                     needUpdateProperties;
    bool                     changingDB;
+
    QReadWriteLock           lock;
    QList<TagShortInfo>      infos;
    QMultiHash<QString, int> nameHash;
@@ -84,6 +87,7 @@
    QList<TagProperty>       tagProperties;
    QHash<QString, QList<int> > tagsWithProperty;
    QSet<int>                internalTags;
+    QMap<ColorLabel, int>       colorLabelsTags;              // Map between color Id and tag label Id created in DB.

    void checkInfos()
    {
@@ -246,9 +250,25 @@
            this, SLOT(slotTagChanged(const TagChangeset&)),
            Qt::DirectConnection);

+    registerColorLabelTagsToDb();
+
    d->initialized = true;
 }

+void TagsCache::registerColorLabelTagsToDb()
+{
+    d->colorLabelsTags.insert(NoneLabel,    getOrCreateInternalTag(InternalTagName::colorLabelNone()));
+    d->colorLabelsTags.insert(RedLabel,     getOrCreateInternalTag(InternalTagName::colorLabelRed()));
+    d->colorLabelsTags.insert(OrangeLabel,  getOrCreateInternalTag(InternalTagName::colorLabelOrange()));
+    d->colorLabelsTags.insert(YellowLabel,  getOrCreateInternalTag(InternalTagName::colorLabelYellow()));
+    d->colorLabelsTags.insert(GreenLabel,   getOrCreateInternalTag(InternalTagName::colorLabelGreen()));
+    d->colorLabelsTags.insert(BlueLabel,    getOrCreateInternalTag(InternalTagName::colorLabelBlue()));
+    d->colorLabelsTags.insert(MagentaLabel, getOrCreateInternalTag(InternalTagName::colorLabelMagenta()));
+    d->colorLabelsTags.insert(GrayLabel,    getOrCreateInternalTag(InternalTagName::colorLabelGray()));
+    d->colorLabelsTags.insert(BlackLabel,   getOrCreateInternalTag(InternalTagName::colorLabelBlack()));
+    d->colorLabelsTags.insert(WhiteLabel,   getOrCreateInternalTag(InternalTagName::colorLabelWhite()));
+}
+
 void TagsCache::invalidate()
 {
    d->needUpdateInfos      = true;
@@ -829,4 +849,12 @@
    }
 }

+int TagsCache::getTagForColorLabel(ColorLabel label)
+{
+    if (label < NoneLabel || label > WhiteLabel)
+        return 0;
+
+    return d->colorLabelsTags[label];
+}
+
 } // namespace Digikam
--- branches/extragear/graphics/digikam/core/libs/database/tagscache.h #1218199:1218200
@@ -6,7 +6,8 @@
 * Date        : 2010-04-02
 * Description : Cache for Tag information
 *
- * Copyright (C) 2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Copyright (C) 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Copyright (C) 2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
@@ -28,6 +29,7 @@

 #include "databasechangesets.h"
 #include "digikam_export.h"
+#include "globals.h"

 namespace Digikam
 {
@@ -186,6 +188,12 @@
     */
    int getOrCreateInternalTag(const QString& tagName);

+    /**
+     * Return internal tags ID corresponding of color label id. see ColorLabel values from globals.h.
+     * Return 0 if not it's found.
+     */
+    int getTagForColorLabel(ColorLabel label);
+
    static QLatin1String tagPathOfDigikamInternalTags(LeadingSlashPolicy slashPolicy = IncludeLeadingSlash);
    static QLatin1String propertyNameDigikamInternalTag();
    static QLatin1String propertyNameExcludedFromWriting();
@@ -205,15 +213,18 @@

 private:

-    friend class DatabaseAccess;
-    friend class TagsCacheCreator;
-    friend class ChangingDB;
-
    TagsCache();
    ~TagsCache();
    void initialize();
    void invalidate();
+    void registerColorLabelTagsToDb();

+private:
+
+    friend class DatabaseAccess;
+    friend class TagsCacheCreator;
+    friend class ChangingDB;
+
    class TagsCachePriv;
    TagsCachePriv* const d;
 };
Comment 50 caulier.gilles 2011-02-01 09:44:12 UTC
SVN commit 1218201 by cgilles:

use Coor Label tags cache from TagsCache class


 M  +5 -40     tagsactionmngr.cpp
 M  +1 -3      tagsactionmngr.h


--- branches/extragear/graphics/digikam/core/digikam/tags/tagsactionmngr.cpp #1218200:1218201
@@ -67,7 +67,7 @@
    {
    }

-    QMap<int, int>            colorLabelsMap;              // <color Id, tag label Id from Db>
+
    QMultiMap<int, KAction*>  tagsActionMap;
    QList<KActionCollection*> actionCollectionList;
 };
@@ -96,39 +96,6 @@
    }
 }

-void TagsActionMngr::registerColorLabelTagsToDb()
-{
-    d->colorLabelsMap.insert(NoneLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelNone()));
-
-    d->colorLabelsMap.insert(RedLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelRed()));
-
-    d->colorLabelsMap.insert(OrangeLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelOrange()));
-
-    d->colorLabelsMap.insert(YellowLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelYellow()));
-
-    d->colorLabelsMap.insert(GreenLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelGreen()));
-
-    d->colorLabelsMap.insert(BlueLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelBlue()));
-
-    d->colorLabelsMap.insert(MagentaLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelMagenta()));
-
-    d->colorLabelsMap.insert(GrayLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelGray()));
-
-    d->colorLabelsMap.insert(BlackLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelBlack()));
-
-    d->colorLabelsMap.insert(WhiteLabel,
-                             TagsCache::instance()->getOrCreateInternalTag(InternalTagName::colorLabelWhite()));
-}
-
 void TagsActionMngr::registerActionCollections()
 {
    d->actionCollectionList.append(DigikamApp::instance()->actionCollection());
@@ -168,15 +135,13 @@

    // Create Color Label shortcuts.

-    registerColorLabelTagsToDb();
-
    QMap<int, int>::const_iterator it;

    foreach(KActionCollection* ac, d->actionCollectionList)
    {
-        for (it = d->colorLabelsMap.begin() ; it != d->colorLabelsMap.end(); ++it)
+        for (int i = NoneLabel ; i > WhiteLabel ; ++i)
        {
-            createColorLabelActionShortcut(ac, it.key(), it.value());
+            createColorLabelActionShortcut(ac, i);
        }
    }
 }
@@ -198,7 +163,7 @@
    return false;
 }

-bool TagsActionMngr::createColorLabelActionShortcut(KActionCollection* ac, int colorId, int tagId)
+bool TagsActionMngr::createColorLabelActionShortcut(KActionCollection* ac, int colorId)
 {
    if (ac)
    {
@@ -208,7 +173,7 @@
        action->setShortcut(KShortcut(QString("ALT+%1").arg(colorId)));
        action->setShortcutConfigurable(false);
        action->forgetGlobalShortcut();
-        action->setData(tagId);
+        action->setData((int)(TagsCache::instance()->getTagForColorLabel((ColorLabel)colorId)));
        connect(action, SIGNAL(triggered()), this, SLOT(slotAssignColorLabelFromShortcut()));
        return true;
    }
--- branches/extragear/graphics/digikam/core/digikam/tags/tagsactionmngr.h #1218200:1218201
@@ -100,10 +100,8 @@
    void createActions();

    bool createRatingActionShortcut(KActionCollection* ac, int rating);
-    bool createColorLabelActionShortcut(KActionCollection* ac, int colorId, int tagId);
+    bool createColorLabelActionShortcut(KActionCollection* ac, int colorId);

-    void registerColorLabelTagsToDb();
-
 private:

    static TagsActionMngr* m_defaultManager;
Comment 51 caulier.gilles 2011-02-01 10:31:36 UTC
SVN commit 1218207 by cgilles:

Add Color Label Selector widget to Captions & Tags view, near Rating widget
CCBUGS: 152424


 M  +38 -1     imagedescedittab.cpp  
 M  +3 -0      imagedescedittab.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218207
Comment 52 caulier.gilles 2011-02-01 10:32:32 UTC
SVN commit 1218208 by cgilles:

MetadataHub now is hable to paly with Color Label information
CCBUGS: 152424


 M  +86 -7     metadatahub.cpp  
 M  +20 -3     metadatahub.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218208
Comment 53 caulier.gilles 2011-02-01 11:28:16 UTC
SVN commit 1218212 by cgilles:

add new method to context menu helper to assign Color label
Patch iconview context menu to provide Color Label selector.
Patch Metadata Manager to handle color Label information with metadata hub
CCBUGS: 152424


 M  +18 -3     contextmenuhelper.cpp  
 M  +15 -0     contextmenuhelper.h  
 M  +16 -0     digikamimageview.cpp  
 M  +2 -0      digikamimageview.h  
 M  +56 -1     metadatamanager.cpp  
 M  +5 -2      metadatamanager.h  
 M  +12 -1     metadatamanager_p.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218212
Comment 54 caulier.gilles 2011-02-01 11:48:16 UTC
SVN commit 1218213 by cgilles:

add ColorLabel action to image preview context menu
CCBUGS: 152424


 U             digikamimageview.cpp  
 M  +13 -0     imagepreviewview.cpp  
 M  +1 -0      imagepreviewview.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218213
Comment 55 caulier.gilles 2011-02-01 12:01:39 UTC
SVN commit 1218214 by cgilles:

connect tag action manager to iconview to hadle Color Label with keyboard shortcuts.
CCBUGS: 152424


 M  +2 -3      digikamapp.h  
 M  +5 -0      digikamview.cpp  
 M  +1 -1      digikamview.h  
 M  +1 -0      tags/tagsactionmngr.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218214
Comment 56 caulier.gilles 2011-02-01 12:15:54 UTC
SVN commit 1218215 by cgilles:

add color label action to image editor context menu
CCBUGS: 152424


 M  +31 -0     imagewindow.cpp  
 M  +2 -0      imagewindow.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218215
Comment 57 caulier.gilles 2011-02-01 12:16:46 UTC
SVN commit 1218216 by cgilles:

connect tags action manager to image editor to handle Color Label keyboard shortcuts
CCBUGS: 152424


 M  +6 -4      tagsactionmngr.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218216
Comment 58 caulier.gilles 2011-02-01 12:42:25 UTC
SVN commit 1218217 by cgilles:

connect LightTable to Tags Action Manager to handle Color Label keyboard Shortcuts
CCBUGS: 152424


 M  +1 -1      tagsactionmngr.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218217
Comment 59 caulier.gilles 2011-02-01 12:42:51 UTC
SVN commit 1218218 by cgilles:

handle Color Label in Light table
CCBUGS: 152424


 M  +17 -0     lighttablebar.cpp  
 M  +3 -0      lighttablebar.h  
 M  +18 -0     lighttablepreview.cpp  
 M  +1 -0      lighttablepreview.h  
 M  +5 -0      lighttablewindow.cpp  
 M  +1 -0      lighttablewindow.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218218
Comment 60 caulier.gilles 2011-02-01 15:02:46 UTC
SVN commit 1218246 by cgilles:

patch itemview image delegate to handle ColorLAbel information.
This draw a simple rectangle around icon view item. This must be improved in the future.
CCBUGS: 152424


 M  +1 -2      colorlabelwidget.cpp  
 M  +1 -2      colorlabelwidget.h  
 M  +20 -2     itemviewimagedelegate.cpp  
 M  +3 -1      itemviewimagedelegate.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218246
Comment 61 caulier.gilles 2011-02-01 15:03:50 UTC
SVN commit 1218247 by cgilles:

handle color label in iconview, following change in itemview image delegate.
CCBUGS: 152424


 M  +5 -2      imagedelegate.cpp  
 M  +1 -1      imagedelegate.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218247
Comment 62 caulier.gilles 2011-02-01 15:24:51 UTC
Marcel,

Where is the code to handle image metadata from files when collection are parsed to fill database.

typically, for rating, code been at this place :

http://lxr.kde.org/source/extragear/graphics/digikam/libs/database/collectionscanner.cpp#1415

It's now commented...

Gilles Caulier
Comment 63 caulier.gilles 2011-02-01 15:30:09 UTC
MArcel,

soundlike all is managed now in ImageScanner class ? 

http://lxr.kde.org/source/extragear/graphics/digikam/libs/database/imagescanner.cpp#238

Gilles Caulier
Comment 64 caulier.gilles 2011-02-01 16:20:54 UTC
SVN commit 1218254 by cgilles:

Show Color Label Information into image properties view
CCBUGS: 152424


 M  +1 -0      imagepropertiessidebardb.cpp  
 M  +1 -0      imagepropertiestab.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218254
Comment 65 caulier.gilles 2011-02-01 16:50:12 UTC
SVN commit 1218259 by cgilles:

Show Color Label in item tooltip.
CCBUGS: 152424


 M  +91 -91    digikam/albumsettings.cpp  
 M  +8 -5      digikam/albumsettings.h  
 M  +11 -6     digikam/tooltipfiller.cpp  
 M  +6 -6      utilities/setup/setuptooltip.cpp  
 M  +2 -3      utilities/setup/setuptooltip.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218259
Comment 66 caulier.gilles 2011-02-02 17:11:29 UTC
Some progress in Color Label support, planed for 2.0.0-beta3:

http://www.flickr.com/photos/digikam/5410850510/sizes/o/in/photostream/
http://www.flickr.com/photos/digikam/5410841604/sizes/o/in/photostream/

Gilles Caulier
Comment 67 caulier.gilles 2011-02-02 17:15:36 UTC
Marcel,

In ImageInfo class, setColorLabel() / colorLabel() methods doesn't work properly with database. Can you take a look please ?

Gilles
Comment 68 caulier.gilles 2011-02-02 20:18:17 UTC
SVN commit 1218526 by mwiesweg:

1) Do not add the color label tag to ImageListerRecord when  it is not filled
  by the IOSlave - data is invalid, but the field was marked as cached.
  (we dont want to change the ioslave binary protocol, it's fast enough to read when needed)
2) Reset colorLabelCached flag at a tag change

colorLabel() work now!



 M  +2 -15     imageinfo.cpp
 M  +2 -0      imageinfocache.cpp
 M  +0 -2      imagelisterrecord.h


--- branches/extragear/graphics/digikam/core/libs/database/imageinfo.cpp #1218525:1218526
@@ -68,7 +68,7 @@
    albumId                = -1;
    albumRootId            = -1;

-    colorLabel             = -1;
+    colorLabel             = NoneLabel;
    rating                 = -1;
    category               = DatabaseItem::UndefinedCategory;
    fileSize               = 0;
@@ -109,7 +109,6 @@
    m_data->albumRootId            = record.albumRootID;
    m_data->name                   = record.name;

-    m_data->colorLabel             = record.colorLabel;
    m_data->rating                 = record.rating;
    m_data->category               = record.category;
    m_data->format                 = record.format;
@@ -118,7 +117,6 @@
    m_data->fileSize               = record.fileSize;
    m_data->imageSize              = record.imageSize;

-    m_data->colorLabelCached       = true;
    m_data->ratingCached           = true;
    m_data->categoryCached         = true;
    m_data->formatCached           = true;
@@ -377,11 +375,8 @@

    if (!m_data->colorLabelCached)
    {
-        m_data.constCastData()->colorLabel = NoneLabel;
        QList<int> tags = tagIds();

-        kDebug() << tags;
-
        foreach(int tagId, tags)
        {
            for (int i = NoneLabel ; i <= WhiteLabel; ++i)
@@ -389,7 +384,6 @@
                if (tagId == TagsCache::instance()->getTagForColorLabel((ColorLabel)i))
                {
                    m_data.constCastData()->colorLabel = i;
-                    kDebug() << i << " :: " << m_data->colorLabel;
                    break;
                }
            }
@@ -398,8 +392,6 @@
        m_data.constCastData()->colorLabelCached = true;
    }

-    kDebug() << m_data->colorLabel;
-
    return m_data->colorLabel;
 }

@@ -1036,19 +1028,13 @@
    int tagId     = tc->getTagForColorLabel((ColorLabel)colorId);
    if (!tagId) return;

-    kDebug() << "Before to assign Color Label: " << tagIds();
-
    // Color Label is an exclusive tags.

    for (int i = NoneLabel ; i <= WhiteLabel ; ++i)
        removeTag(tc->getTagForColorLabel((ColorLabel)i));

-    kDebug() << "All Color Label removed: " << tagIds();
-
    setTag(tagId);

-    kDebug() << "Color Label assigned: " << colorId << " :: " << tagId << " (" << tagIds() << ")";
-
    m_data->colorLabel                       = colorId;
    m_data.constCastData()->colorLabelCached = true;
 }
@@ -1091,6 +1077,7 @@
        return;
    }

+    kDebug() << m_data->id << tagID;
    DatabaseAccess access;
    access.db()->addItemTag(m_data->id, tagID);
 }
--- branches/extragear/graphics/digikam/core/libs/database/imageinfocache.cpp #1218525:1218526
@@ -30,6 +30,7 @@
 #include "imageinfo.h"
 #include "imageinfolist.h"
 #include "imageinfodata.h"
+#include <kdebug.h>

 namespace Digikam
 {
@@ -212,6 +213,7 @@
        if (it != m_infos.end())
        {
            (*it)->tagIdsCached = false;
+            (*it)->colorLabelCached = false;
        }
    }
 }
--- branches/extragear/graphics/digikam/core/libs/database/imagelisterrecord.h #1218525:1218526
@@ -65,14 +65,12 @@
        imageID     = -1;
        albumID     = -1;
        albumRootID = -1;
-        colorLabel  = -1;
        rating      = -1;
        fileSize    = -1;
    }

    int                    albumID;
    int                    albumRootID;
-    int                    colorLabel;
    int                    rating;
    int                    fileSize;
Comment 69 caulier.gilles 2011-02-02 20:44:43 UTC
Marcel,

Thanks to patch ImageInfo.

Still TODO to complete Color Label support in digiKam :

1/ image import : add image metadata parsing to turn on right Color Label automatically image in database. digiKam save Color Label info in digiKam XMP namespace.

2/ Icon View items filter based on Color Label.

3/ Advanced Search tool : to be able to find items by Color Label

4/ Light Table Bar : it do not support yet Color Label, because widget is not yet ported to Qt4 model View.

Your viewpoint/tips ?

Gilles
Comment 70 Marcel Wiesweg 2011-02-02 21:50:33 UTC
> 1/ image import : add image metadata parsing to turn on right Color Label
> automatically image in database. digiKam save Color Label info in digiKam XMP
> namespace.

Must be done in ImageScanner, in scanTags for example.

> 
> 2/ Icon View items filter based on Color Label.

Filtering is implemented in ImageFilterSettings in libs/models. If I dont miss something, it can simply be done using the tags filter.

> 
> 3/ Advanced Search tool : to be able to find items by Color Label

This is difficult. To save space, there are usually combo boxes. Or something similar, with a popup. A checkbox for each color. Not sure if there is an easy way.

> 
> 4/ Light Table Bar : it do not support yet Color Label, because widget is not
> yet ported to Qt4 model View.

Oh yes. It should be ported ;-) It will be very similar to the ImageWindow thumbnail bar.
Comment 71 caulier.gilles 2011-02-02 23:14:13 UTC
1/ Ok, i take a look.

2/ I don't know this implementation using model... About GUI, i think that we can use the widget dedicated to advanced search. See below...

3/ For the Color Label selection box, i can do it. It's easy. Something hosted in a combbox... Not too difficult. For the engine to patch it's another stuff. 

4/ Yes, LT thumbbar is very similar than editor thumbbar. the only difference is the way to display with an overlay over thumb where is display the image in dual canvas (on the right or on the left panel). I think it's not too complicated.
In LT, Thumbbar pop-up menu is present too.

Gilles Caulier
Comment 72 caulier.gilles 2011-02-03 15:13:41 UTC
Marcel,

4/ About thumbbar, i take a look in source code, and i see that showfoto always use the old object based on Qt3 transition class.
I think we cannot use ImageThumbnailBar directly in showfoto because it depend of digiKam core components as AlbumSettings. We need another parent class of ImageThumbnailBar, based on ImageCategorizedView dedicated for Showfoto.

Gilles
Comment 73 caulier.gilles 2011-02-03 18:58:10 UTC
SVN commit 1218671 by cgilles:

temporary solution to draw color label under Light Table, until lighttablebar will use Qt4 model view port
CCBUGS: 152424


 M  +11 -0     lighttablebar.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1218671
Comment 74 Marcel Wiesweg 2011-02-03 21:47:32 UTC
> 3/ For the Color Label selection box, i can do it. It's easy. Something hosted
> in a combbox... Not too difficult. For the engine to patch it's another stuff. 

Patching the search backend will not be too difficult. I can do it, remind me if I forget.

> 4/ About thumbbar, i take a look in source code, and i see that showfoto always
> use the old object based on Qt3 transition class.
> I think we cannot use ImageThumbnailBar directly in showfoto because it depend
> of digiKam core components as AlbumSettings. We need another parent class of
> ImageThumbnailBar, based on ImageCategorizedView dedicated for Showfoto.

The main problem is the dependency on ImageInfo (and thus in libdigikamdatabase). ImageThumbnailBar is very small, most of the code is in ImageCategorizedView (ImageInfo dependent) and DCategorizedView. The idea for showfoto would be to create a not-ImageInfo dependent solution based on DCategorizedView, ItemViewImageDelegate and a model, probably best based on a filesystem model.
Comment 75 caulier.gilles 2011-02-08 14:38:44 UTC
Git commit 1c83ab8339832630f3a1d3a39f9d085ddba2a1f8 by Gilles Caulier.
Committed on 08/02/11 at 14:28.
Pushed by cgilles into branch 'development/2.0'.

In first run dialog, use MetadataSettings to write information to digiKam rc config file
Turn on Color Label info to write in metadata if user is agree to update image information to files.
Use more private internal containers.
CCBUGS: 152424

M  +2    -2    utilities/firstrun/assistantdlg.cpp     
M  +2    -3    utilities/firstrun/assistantdlg.h     
M  +2    -2    utilities/firstrun/assistantdlgpage.cpp     
M  +2    -3    utilities/firstrun/assistantdlgpage.h     
M  +2    -2    utilities/firstrun/collectionpage.cpp     
M  +2    -3    utilities/firstrun/collectionpage.h     
M  +14   -12   utilities/firstrun/metadatapage.cpp     
M  +2    -3    utilities/firstrun/metadatapage.h     
M  +2    -2    utilities/firstrun/openfilepage.cpp     
M  +2    -3    utilities/firstrun/openfilepage.h     
M  +2    -2    utilities/firstrun/previewpage.cpp     
M  +2    -3    utilities/firstrun/previewpage.h     
M  +2    -2    utilities/firstrun/rawpage.cpp     
M  +2    -3    utilities/firstrun/rawpage.h     
M  +1    -1    utilities/firstrun/startscanpage.cpp     
M  +1    -1    utilities/firstrun/startscanpage.h     
M  +2    -2    utilities/firstrun/tooltipspage.cpp     
M  +2    -3    utilities/firstrun/tooltipspage.h     
M  +1    -1    utilities/firstrun/welcomepage.cpp     
M  +1    -1    utilities/firstrun/welcomepage.h     

http://commits.kde.org/digikam/1c83ab8339832630f3a1d3a39f9d085ddba2a1f8
Comment 76 caulier.gilles 2011-02-08 15:59:26 UTC
Git commit 14f8aa431dacf268e129678700c6b200501edbae by Gilles Caulier.
Committed on 08/02/11 at 15:50.
Pushed by cgilles into branch 'development/2.0'.

implement Color Label import to database when item is add to collection.
Properties is restaured from digiKam XMP namespace
CCBUGS: 152424

M  +20   -4    libs/database/imagescanner.cpp     
M  +6    -3    libs/database/imagescanner.h     

http://commits.kde.org/digikam/14f8aa431dacf268e129678700c6b200501edbae
Comment 77 caulier.gilles 2011-02-09 12:09:53 UTC
Bibble Labels "Pick" :

I just see in bibble web site that Color Labels are supported :

http://bibblelabs.com/products/bibble5/features/metadata.html

... but not only. There is "Pick" annotation available.

Somebody in this room know this feature ?

Gilles Caulier
Comment 78 Émile Cordonnier 2011-02-09 14:12:26 UTC
"Versions can be marked a Tagged, Rejected, or Untagged.  Marking a version as Tagged is a great way to make a quick indication of images in your Catalog.  You might use the Tag indicator to mark images that you are in the process of editing, removing the tag from finished images (and perhaps apply a Label as well).  Or perhaps you Tag several images with similar content so you can quickly select then to compare and select the best.

Marking an image as Rejected will help you keep your catalog free of out of focus, or otherwise poor quality images.  One workflow would be to scan through new images, marking the poor quality images as Rejected.  Once all images have been reviewed, Filter the Thumbnail View to show only the rejected images to verify that you marked only the poor quality images, then permanently delete the Rejected images.  Or keep the images, leaving them as Rejected to prevent them from showing up in the standard view of your Catalog, while leaving them on your computer just in case you do need that image later."
(http://bibblelabs.com/products/bibble5/learn/webhelp/index.html?labels_ratings_and_tags.html)

Darkroom has the same feature (and probably other softwares as I think it is a standard for xmp: like color tags or rating it can be read by other softwares). 

https://bugs.kde.org/show_bug.cgi?id=241847 asked for this kind of feature. I remember another wish asking for this "Pick/Rejected" feature, but I don't find it. If I remember correctly, the answer was that it can be done with stars. For my part, I think it is useful; it can be done with stars but sometimes it is less handy.
Comment 79 Émile Cordonnier 2011-02-09 14:17:15 UTC
"Darkroom" -> Lightroom, sorry
Comment 80 caulier.gilles 2011-02-09 14:22:42 UTC
Thanks Emile,

I thinking that all these workflow attributes (accepted/refused images) can be managed with Color Labels as well.

Marcel, please, give me your viewpoint about "Pick" tag. Relevant entry is 

https://bugs.kde.org/show_bug.cgi?id=241847 

Gilles Caulier
Comment 81 caulier.gilles 2011-02-09 16:06:35 UTC
Git commit f2fa5eb39c469e1ddf0d98f4fb4f421b648e461b by Gilles Caulier.
Committed on 09/02/11 at 15:57.
Pushed by cgilles into branch 'development/2.0'.

Introduce Color Label Filter widget. This widget show a list of color label selectable (through check-box).
This widget will be used to perform Color Labels icon-view filter from statusbar.
A preview of this widget in action is given below:

http://www.flickr.com/photos/digikam/5431174228/sizes/o/in/photostream/

Note: On status bar, push button text is the count of color label checked.
For the moment this button is not displayed. Icon-view filtering by Color Label is not yet implemented.
CCBUGS: 152424

M  +1    -0    CMakeLists.txt     
M  +19   -30   digikam/albumiconviewfilter.cpp     
M  +2    -3    digikam/albumiconviewfilter.h     
A  +163  -0    digikam/tags/colorlabelfilter.cpp         [License: GPL (v2+)]
A  +105  -0    digikam/tags/colorlabelfilter.h         [License: GPL (v2+)]

http://commits.kde.org/digikam/f2fa5eb39c469e1ddf0d98f4fb4f421b648e461b
Comment 82 caulier.gilles 2011-02-10 09:30:00 UTC
Git commit 37fefa894273c8067a1f1fe987be7afa7e5716fc by Gilles Caulier.
Committed on 10/02/2011 at 09:25.
Pushed by cgilles into branch 'development/2.0'.

prepare album icon-view filter to use Color Laber filter.

M  +13   -8    digikam/albumiconviewfilter.cpp
M  +3    -1    digikam/albumiconviewfilter.h
M  +1    -1    digikam/tags/colorlabelfilter.cpp
M  +3    -1    digikam/tags/colorlabelfilter.h

http://commits.kde.org/digikam/37fefa894273c8067a1f1fe987be7afa7e5716fc
Comment 83 caulier.gilles 2011-02-10 10:33:38 UTC
Git commit 1d58cce801b12b60fe6a4031ae302453ee0a9d4f by Gilles Caulier.
Committed on 10/02/2011 at 10:24.
Pushed by cgilles into branch 'development/2.0'.

Color Label icon-biew filter is implemented and fully suitable.
Color Label Filter widget have been moved fro status bar to Tag Filter Sidebar tab. Like this,
we can apply the same filter conditions between tags filters and color label filters.

A screenshot : http://www.flickr.com/photos/digikam/5432694899/sizes/o/in/photostream/

CCBUGS: 152424

M  +0    -11   digikam/albumiconviewfilter.cpp     
M  +0    -2    digikam/albumiconviewfilter.h     
M  +35   -8    digikam/tagfiltersidebarwidget.cpp     
M  +3    -1    digikam/tagfiltersidebarwidget.h     
M  +22   -36   digikam/tags/colorlabelfilter.cpp     
M  +5    -24   digikam/tags/colorlabelfilter.h     

http://commits.kde.org/digikam/1d58cce801b12b60fe6a4031ae302453ee0a9d4f
Comment 84 caulier.gilles 2011-02-10 10:39:59 UTC
Marcel,

Icon-view Color Labels filtering is now implemented. Please take a look if all is fine for you... I'm not sure about OR/AND condition rules here.

Still Color Labels support to add in Advanced Search tool, and all will be completed.

Gilles Caulier
Comment 85 caulier.gilles 2011-02-10 10:42:44 UTC
Marcel, 

in fact, as Color label are exclusive, only OR operation can be done between Color Labels.

But AND/OR operators can be done between Color Labels and Tags. This is more complex that i think...

If you try AND operator in Tags Filter, using only Color Labels, of course it don't work...

Gilles Caulier
Comment 86 caulier.gilles 2011-02-10 12:19:09 UTC
Marcel,

the AND/OR logic between Tags and Color Labels in Tags Filter View is given below:

AND : (tags && tags && tags && ...) && (CL || CL || CL || ...)
OR  : (tags || tags || tags || ...) || (CL || CL || CL || ...)

Fine for you ?

Gilles Caulier
Comment 87 caulier.gilles 2011-02-10 16:20:31 UTC
Created attachment 57111 [details]
moc-up for Advanced Search tool with Color Labels.

Marcel,

in git, ColorLabelWidget has a non exclusive mode for Advanced Search tool. Typically, in this mode you can select more that one Color Labels at the same time. Also, description view on the bottom can be disabled with the right method.

I think you can use it as well in Advanced Search dialog, as i propose in my moc-up.

Gilles Caulier
Comment 88 caulier.gilles 2011-02-11 07:00:09 UTC
Git commit f5eb8563a93880cf556477068d4f9d015464fc72 by Gilles Caulier.
Committed on 11/02/2011 at 06:56.
Pushed by cgilles into branch 'development/2.0'.

Since Color Label Widget has a non-exclusive mode, we can use it as cal label filter
to make an homogenous GUI everywhere and to optimize space in Tags Filter view.
CCBUGS: 152424

M  +5    -5    digikam/tagfiltersidebarwidget.cpp     
M  +8    -91   digikam/tags/colorlabelfilter.cpp     
M  +3    -25   digikam/tags/colorlabelfilter.h     
M  +1    -1    digikam/tags/ratingfilter.h     
M  +4    -6    libs/widgets/common/colorlabelwidget.cpp     
M  +3    -3    libs/widgets/common/colorlabelwidget.h     

http://commits.kde.org/digikam/f5eb8563a93880cf556477068d4f9d015464fc72
Comment 89 caulier.gilles 2011-02-11 11:47:02 UTC
Created attachment 57154 [details]
Patch for Advanced Search tool to support Color Labels.

Marcel,

This is a patch to add Color Labels support in Advanced Search tool.

GUI for fine, but not search result in icon view...

Can you take a look ? Thanks in advance

Gilles Caulier
Comment 90 caulier.gilles 2011-02-11 12:16:45 UTC
Marcel, 

See on my Flickr account how Color Labels have been integrated to Advanced Search tool :

http://www.flickr.com/photos/digikam/5435456951/sizes/o/in/photostream/

Gilles Caulier
Comment 91 caulier.gilles 2011-02-11 12:19:09 UTC
Created attachment 57156 [details]
Patch for Advanced Search tool to support Color Labels.

update patch for better gui layout.

Gilles Caulier
Comment 92 caulier.gilles 2011-02-11 13:48:47 UTC
Marcel,

I found a strange bug in "Caption & Tags".

1/ Assign a color Green for ex.
2/ now try to assign Red => it still Green.
3/ now try to assign Black => it's ok.

In fact, trying to assign a color label id < of current one doesn't work. Assigning a color label id > of current one work fine.

Note : from context menu, i cannot reproduce the problem.

Can you reproduce it on your computer ?

Gilles Caulier
Comment 93 Marcel Wiesweg 2011-02-12 14:46:32 UTC
Git commit 16d80e8af51f02bf149c65318ce24685b581eb6b by Marcel Wiesweg.
Committed on 12/02/2011 at 14:43.
Pushed by mwiesweg into branch 'development/2.0'.

Ignore internal tags in MetadataHub
As color labels are tags, the tag part of the hub would always re-add
any previously added color label tag (after the color label part removed it).
If multiple color label tags are present, the highest tag id wins, which created
the impression that you could not change to a "lower" color.

CCBUG: 152424

M  +5    -0    digikam/metadatahub.cpp     

http://commits.kde.org/digikam/16d80e8af51f02bf149c65318ce24685b581eb6b
Comment 94 caulier.gilles 2011-02-14 15:00:15 UTC
Git commit 05d0b7000f580e916eadaf4edfdbb1dbb875816e by Gilles Caulier.
Committed on 14/02/2011 at 14:57.
Pushed by cgilles into branch 'development/2.0'.

re-implement Color Label Filter filter rule. More simple without to use tag filter rules (as rating, text, mime, etc...)
CCBUGS: 152424

M  +4    -2    digikam/digikamview.cpp     
M  +16   -15   digikam/tagfiltersidebarwidget.cpp     
M  +5    -5    digikam/tagfiltersidebarwidget.h     
M  +7    -5    libs/models/imagefiltermodel.cpp     
M  +6    -3    libs/models/imagefiltermodel.h     
M  +43   -16   libs/models/imagefiltersettings.cpp     
M  +12   -7    libs/models/imagefiltersettings.h     

http://commits.kde.org/digikam/05d0b7000f580e916eadaf4edfdbb1dbb875816e
Comment 95 caulier.gilles 2011-02-14 15:34:28 UTC
Git commit 91d58743f3d5524bfdcd47c706a16fc51eec485b by Gilles Caulier.
Committed on 14/02/2011 at 15:30.
Pushed by cgilles into branch 'development/2.0'.

Implement fully suitable Color Labels Search option in Advanced Search tool !
Marcel, i found the problem with Color Label and XML database query.
Look my comment in SearchFieldLabel::write() method. It work fine.
Feel free to customize Database XML query for Color Label, but i think this way is enough.
BUGS: 152424

M  +7    -0    libs/database/tagscache.cpp     
M  +6    -0    libs/database/tagscache.h     
M  +108  -2    utilities/searchwindow/searchfields.cpp     
M  +29   -1    utilities/searchwindow/searchfields.h     
M  +3    -1    utilities/searchwindow/searchgroup.cpp     
M  +2    -1    utilities/searchwindow/searchgroup.h     

http://commits.kde.org/digikam/91d58743f3d5524bfdcd47c706a16fc51eec485b