Project

General

Profile

Bug #11353

Keyboard navigation in darkroom skips/loops over a subset of images if a color rating is selected through collect images on Fedora

Added by S W about 3 years ago. Updated about 3 years ago.

Status:
Duplicate
Priority:
Low
Assignee:
-
Category:
Darkroom
Target version:
Start date:
12/09/2016
Due date:
% Done:

0%

Estimated time:
Affected Version:
2.2.0rc2
System:
Fedora/RHEL
bitness:
64-bit
hardware architecture:
amd64/x86

Description

This issue was encountered on Fedora 25 with darktable 2.2.0~rc2 and appears to be reproducible for this image set.

Instructions

  1. Sort images by date and time
  2. Assign color ratings to images
  3. Collect images by a given color rating
  4. Double-click on the first image to enter the darkroom view
  5. Press space to navigate to the next image, which is not the next image on the filmstrip

Workaround

A quick, if inefficient fix, would be to request all rows in the result set, rather than the first one. However, there also seems to be an underlying issue somewhere.

Details

It appears that limiting result row count to 1 in dt_dev_jump_image within darkroom.c in conjunction with the color rating filter yields an image id that fulfills the flag and color label criteria, but does not fulfill the order by criteria. Changing the row count to something larger (e.g., -1 or 7) does seems to yield the correct next image ID.

The same behavior can be replicated when interacting with the SQLite database file directly.

For example, using the SQL dumped from sqlite3_expanded_sql as called from darktable,

select 
  id 
from 
  main.images 
where 
  (flags & 256) != 256 and
  (id in (select imgid from main.color_labels where color = 0))
order by
  datetime_taken,
  filename,
  version

yields 1379, 1382, 1385 ...

If one were to enter the darkroom view with the first image,

select
  imgid
from
  main.selected_images

yields 1379.

The offset as determined by dt_collection_image_offset in collection.c is 0, as expected.

The following should yield the next image

select 
  id 
from 
  main.images 
where 
  (flags & 256) != 256 and
  (id in (select imgid from main.color_labels where color = 0))
order by
  datetime_taken,
  filename,
  version
limit 1,1

but returns 360, not 1382.

select 
  id 
from 
  main.images 
where 
  (flags & 256) != 256 and
  (id in (select imgid from main.color_labels where color = 0))
order by
  datetime_taken,
  filename,
  version
limit 1,-1

does yield 1382, 1385...

This issue was also present in the 2.0.7 release from the Fedora repositories, but could not be reproduced with the git master branch in Ubuntu 16.04.1 LTS using a different set of photos. Cycling through photos without filtering by color rating did result in sequential navigation.

History

#1 Updated by S W about 3 years ago

Similarly, there appears to be an issue where the limit component is filtering out certain images (that would be returned if the row limit were set to -1) via _lib_filmstrip_draw_callback in filmstrip.c. In this case, an image can be opened from lighttable, but not appear on the filmstrip in darkroom.

libsqlite3.so.0 from /lib64/libsqlite3.so.0 appears to be linked for darktable and the standard sqlite package is installed.

#2 Updated by Roman Lebedev about 3 years ago

Which sqlite version?
Sounds just like some other issue in here (which i can not find), which was a sqlite bug, which got fixed upstream.

#3 Updated by S W about 3 years ago

3.14.2 from 2016-09-12. According to [[https://www.sqlite.org/releaselog/3_15_0.html]], the issue was fixed in the next release from 2016-10-04, but 3.14.2 per [[https://apps.fedoraproject.org/packages/sqlite]] is the latest generally available package for Fedora 25.

For release 3.15.0 onwards:

Make sure the ORDER BY LIMIT optimization (from check-in 559733b09e) works with IN operators on INTEGER PRIMARY KEYs. Fix for ticket 96c1454c

#4 Updated by Roman Lebedev about 3 years ago

  • Status changed from New to Duplicate

So i take it the only problem here is the sqlite version packaged in fedora?

#5 Updated by S W about 3 years ago

Yes (and any workarounds/fedora advocacy to get the issue resolved before release)?

#6 Updated by Germano Massullo about 3 years ago

Open a bugreport at https://bugzilla.redhat.com/ against sqlite component

#7 Updated by S W about 3 years ago

Germano Massullo wrote:

Open a bugreport at https://bugzilla.redhat.com/ against sqlite component

Filed: https://bugzilla.redhat.com/show_bug.cgi?id=1403328

Also available in: Atom PDF

Go to top