Summary: | Search for non-voted pics | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Warren Werner <0815jo> |
Component: | Searches-Labels | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 0.9.1 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.3 | |
Sentry Crash Report: | |||
Attachments: | also find never rated images |
Description
Warren Werner
2007-07-01 20:39:55 UTC
You are talking about setting up an advanced search, right? For this I just tried to reproduce your problem, but with current svn everything seems to work as expected. Could you try with 0.9.2 (packages for feisty are already available) and see if the problem persists? Many thanks in advance, Arnd Now I installed v 0.9.2-final and the problem persists. I have an Album with 12 pictures, most of them with 0 stars. If I set in the advanced search the rules: Album = Twelve-Pictures AND Voting >= 0 I get only 4 Pictures, which first I gave 5 stars and then set to 0 and 1 pic with 4 stars. Similar result I get with the variations Voting <= 0 (same result without the 4-star-pic); Voting = 0 (same result without the 4-star-pic). I hope not to be too confusing. The thing I wanted to say: The problem is not resolved in 0.9.2-final Josef, you are right, now I can reproduce the problem (not sure why I did not see it last time. As far as I understand things, the origin of the problem is the following search sent to the sql database SELECT Images.id, Images.name, Images.dirid, Images.datetime, Albums.url FROM Images, Albums LEFT JOIN ImageProperties ON Images.id = Imageproperties.imageid WHERE ( (Images.dirid IN (SELECT id FROM Albums WHERE url LIKE '%Star%')) AND (ImageProperties.value >= '0' and ImageProperties.property='Rating') ) AND (Albums.id=Images.dirid); I think that whenever an item has not yet been rated at all, ImageProperties.property='Rating' does not exist. Setting it to some value and back to 0 creates that field in the database so that the above AND is fulfilled. So whenever, ImageProperties.value >= '0' or ImageProperties.value = '0' or ImageProperties.value <= '0' is asked for, it should be presumably something like (symbolically) AND ( (ImageProperties.value >= '0' and ImageProperties.property='Rating') OR (there_is_no ImageProperties.property='Rating') ) Marcel, I think a database expert is needed here ...;-) (i.e., can one do this somehow?) Another option would be to define all images in the database with rating=0... Marcel, is there a way to setup a query so that images which have not been rated before can be found as well? If you could give me some hints, I would try to solve this here. Best, Arnd This could work: WHERE Images.id NOT IN (SELECT imageid FROM ImageProperties WHERE property='Rating'); Don't know if there is something more elegant. Created attachment 21518 [details]
also find never rated images
The attached patch modifies the rating search such
that also never rated images are found on a search for
- rating=0
- rating>=0
- rating<=0
- rating<c (with c=1,2,3,4,5)
- rating<=c
- rating<>c
My test cases work fine, but it would be good if someone else
could check this patch!
Josef, Are you tried patch provided by Arnd ? Gilles I did not manage to install digikam from source since i have already installed a version. But a general Question: Isn't it useful if it is possible to differ between non-voted-0-star and voted-0 star (very ugly pic)? Maybe it was better to add an option to choose non-voted-pics or to include them. But also this brings problems With it. Mybe it is better to define 1-star-pics as ugly and 0-star-pics as "dont-know" Could anyone else test the patch of Arnd? - you could always install to a separate place without interfering with any other installation (see http://www.digikam.org/?q=download) - I don't think it is a good idea to differentiate between never rated and 0-rated. There is no visual difference between them and therefore no feed-back. Also sometimes you associate (accidentally) 1-star just to realize there is another even better variant of that shot, so the 1-star is changed to 0-star. Is that one better than never rated? Arndt, I dont feel up to compiling it, sorry. I think you are right about the 0-rated and never-rated. Is ist going to be patched for the next version? With the 0.9 db schema the rating has no real place, so this problem arises. In 0.10 the situation will be different: There will of course be a rating field for every image, currently initialized with 0. (this introduces a question: Shall this be like this, or shall an image without rating have a rating of -1?) I think there will be no visual difference for the user between -1 and 0, so I would suggest 0 as default. Do you think the patch is ok to be committed? (And: as you wrote, it need not be backported to KDE4, right?) Other possibility: If the picture is not voted, the stars are light grey. If the picture is voted (f.e. 3 stars) then three stars are yellow and two are light blue (f.e.). So if it is 0-rated, all stars are light blue and you see the difference. If we did so, we had also to add the option "unvote" to remove the vote. Essentially this means to introduce -1 as another rating level to the existing 0, 1, 2, 3, 4, 5. While the last suggestion is a good proposal, I am not sure whether it is worth the coding effort ... ;-) For the moment, I would suggest to treat never rated images the same way as 0-rated (as the patch does), to fix an important bug. Anything beyond this is surely an option which can be discussed, in particular in the context of digikam >=0.10 (i.e KDE4). SVN commit 731108 by abaecker: Treat non-voted pictures as if they have 0-rating when doing a search. CCBUGS: 147426 TODO:KDE4PORT M +3 -2 NEWS M +15 -2 kioslave/digikamsearch.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=731108 For the port to KDE4: The logic to be considered for 0.10 are the cases: a) For val = 0: i) >= 0 corresponds to search for >=-1 I.e, choose: val = -1, op = GTE ii) == 0 corresponds to search for ==0 or == -1 I.e, choose: val = 0, op = LTE iii) <= 0 corresponds to search for ==0 or == -1 i.E. choose val = 0, op = LTE b) For val >0: < val <= val != val So case b) does not need any special treatment anymore as -1 < 0 ;-). Marcel, Gilles: if for the KDE4 branch the default rating value is 0, is it correct that nothing has to be changed and this bug can be closed? Arnd, Warning: This is the only B.K.O file witch is not yet ported to KDE4. kioslave/digikamsearch.cpp need to be rewritten as well. Marcel, i suppose than you have planned to do it... Right ? Gilles The KDE4 version has an explicit way of searching for non-rated pictures. For one, all pictures have an assigned rating value (-1 initially, which means not assigned). In the advanced search window, in the rating search widget, you can select "No Rating Assigned". I plan to add "No rating assigned or Rating 0" as well. |