When I group all photos in album (RAW+JPEG) by time, it work's except one pair.
Steps to Reproduce:
1. go to album with photo pairs RAW+JPEG
2. select all
3. use function group selected by time (or similar - I don't use English version)
All files are grouped, except one (in first 10). Sometimes problem not appear.
Created attachment 74095 [details]
Can you please send me two screenshots? One showing the group option you select and other showing the problem in the image area? It doesnt need to be in English. We will figure that out.
> Can you please send me two screenshots? One showing the group option you select
> and other showing the problem in the image area? It doesnt need to be in
> English. We will figure that out.
OK, they are two screenshots
error0.png: polish option "Pogrupuj wybrane wg. czasu" (translate
error - properly "wg." is without dot at end)
error1.png: photo DSC05096.(ARW and JPG) aren't groupped. when I
change sort order, photo with error is another.
Created attachment 74096 [details]
I am not able to reproduce it here. However it might be possible that the time might be different by "seconds". to check that
(a) click on captions/tags on the right pane
(b) check the date and time
i have attached a screenshot to guide you how to reproduce the above steps.
if both are same for both the "raw" and "jpeg" image, then send those files to me here.
Created attachment 74130 [details]
description for checking the date
I found regularity of this bug. I click right button of mouse for display context menu over one of photos, and pair with this file is not created.
Created attachment 74965 [details]
I am not sure what you mean by your last comment. Can you give some screenshot of what you are referring to?
2012/11/3 Smit Mehta <email@example.com>:
> --- Comment #7 from Smit Mehta <firstname.lastname@example.org> ---
> Hi Marek
> I am not sure what you mean by your last comment. Can you give some screenshot
> of what you are referring to?
OK. Step by step:
1. I select all photos in album, and open context menu over any photo
in my example - IMG_0230.JPG (screen1.jpg)
2. After select group by time (pogrupuj wybrane wg czasu), all
selected files are grouped, exclude pair with this photo (screen2.jpg)
Bug doesn't appear when context menu is opened over any photo from
first pair in album (screen1a.jpg and screen2a.jpg)
Created attachment 74966 [details]
Created attachment 74967 [details]
Created attachment 74968 [details]
Marek, thanks for your precise analysis.
Smit, look at DigikamImageView::createGroupByTimeFromSelection(), first line:
QList<ImageInfo> selectedInfos = selectedImageInfosCurrentFirst();
"CurrentFirst" -> current info is prepended in the list, thus out of order. Can be replaced by the more simple selectedImageInfos().
Why is that a problem at all? The algorithm is simple, but seems to imply that the infos are sorted by date, which is often the case, but in no way guaranteed. Easiest way to fix is to qSort() the list with a custom lessThan method which sorts by date/time.
When it comes to nit-picking optimization, an algorithm which only iterates (by incrementing index or iterator) without editing the list (takeFirst) will be slightly more efficient.
Git commit 729399dcd5bf63046097ed3e479e2d2906ed82cc by Marcel Wiesweg.
Committed on 12/01/2013 at 18:47.
Pushed by mwiesweg into branch 'master'.
Rewrite algorithm for grouping by time:
- sort list by date, dont take this state for granted
- iterator-based on read-only list, less expensive than list editing
Works for me, testing appreciated.
M +27 -8 digikam/items/digikamimageview.cpp