[Digikam-devel] [Bug 91562] Change order of pictures in the virtual album manually

Francesco Riosa francesco+kde at pnpitalia.it
Thu Aug 25 19:23:13 BST 2011


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





--- Comment #26 from Francesco Riosa <francesco+kde pnpitalia it>  2011-08-25 18:23:12 ---
(In reply to comment #25)
> I'm a bit skeptical to regard the order as a single property of a picture. Isnt
> rather the order of a group of pictures the property of a presentation,
> allowing a picture to be member of multiple presentations with different
> neighbors?
> 
> If we store an order like a z-level per picture, it works in one view (album)
> with a defined group of neighboring images, but can be completely off in the
> next view (tag, date).

Assuming:
1) the order should be unique in the whole collection, cross all the albums.
2) Only user marked images have an order, the other are neutral.

This way we can hope the order make sense also if the views are different, if
this is too far fetched then we can keeping the previous assumptions:

create a table for sorting the images with the following properties:
image id,
view kind,
z index (or x,y,z for a spatial conscious album ;)

image id and z index are obvious, view kind could be of two types, "default" or
a specific view descriptor {"album", "date", "tag"} this way we can:

a) chose to give or not a default order for the image
b) use the view order and fallback to a default one

Speaking of sql the only way I can think of it is a subquery which could look
like this (mysql dialect):

(
SELECT 
  o.`z index`,
  o.`view kind`
FROM imageSorting AS o
WHERE o.`imageid` = ?id
  AND o.`view kind` IN ("default", ?view_kind)
ORDER BY (o.`view kind` = ?view_kind) DESC
LIMIT 1
)
result may be NULL

Be warned this is both complex and slow.

what do you think?

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list