[mythtv-users] MythGallery: selecting a favorite picture as directory thumb

Angela angela.schmid at wolke7.net
Sun Oct 12 09:29:43 UTC 2014


>> I would like to select a picture/thumb to be used as a directory thumb 
>> (in
>> the parent view).
>>
>> At the moment to create a directory thumb it recursives in the directory 
>> to
>> find the first possible picture and uses it to create a thumb.
>>
>> In iconview.cpp I found the following code:
>>
>> if (item->IsDir())
>> { // try to find a highlight
>> QDir subdir(item->GetPath(), "*.highlight.*",
>> QDir::Name, QDir::Files);
>>
>> I renamed XXXX.JPG to XXXX.highlight.JPG but it was not picked up as the
>> favorite picture to generate a directory thumb (the .thumbcache has been
>> deleted).
>> What does this code do/how should it be used?
>>
>> Is there a way to set a favorite picture as the directory thumb or is
>> something broken?
>>
>> Angela
>>

>That code isn't being used - it's old code for interfacing with
http://galleryproject.org/. See
http://marc.info/?l=mythtv-dev&m=107994033415454
>
>I don't believe there is a way to specify a folder thumb currently. 
>
>However it shouldn't be difficult to add. I knocked up the attached (0.28)
patch that uses a thumb called "folder.*", if it exists. I haven't tested it
properly but it's a start. (I'm not convinced 'folder' will >always be the
first file returned)

I didn't noticed the above code was not used. I have to use some debug
statements to see the actual flow.
Your patch would do something similar as the code above.

When I want to implement a key and select it from MythTV, what I don't like
from the above code:

Reason 1: is that pictures get renamed or a second file with something like
*highlight* is added. It overcomplicates programming, when a highlighted
picture already exists.

Reason 2: I keep my pictures synced (Beyond Compare) between a PC (editing
and source for off-loaded backup) and MythTV Server (second backup), I don't
want changes of filenames or additions.

Reason 3: When changing Themes it might be needed to drop the .thumbcache's,
as they might have a different size (another algorithm of mine, was to copy
the thumb of a favorite picture to the parent directory thumb)

Reason 4: It also does not solve when I have the following structure where I
want to use a picture say from the second subdirectory for a parent-parent
directory.

2003/200301 Egypt/20030101 Cairo
2003/200301 Egypt/20030101 Cairo/pic0001.tiff
2003/200301 Egypt/20030102 Abu Simbel
2003/200301 Egypt/20030102 Abu Simbel/want-this-pic.tiff

I am thinking of another algorithm, which also works for highlighting
directories (when they don't have pictures at that level):

Within "2003/200301 Egypt/20030102 Abu Simbel/" at "want-this-pic.tiff" I
press a key and a file ".directory.thumb.txt" with "want-this-pic.tiff" is
written.
As I go back to Within "2003/200301 Egypt/" the directory is reread and code
like above looks first for a file ".directory.thumb.txt" and uses the
content as the filename, which is also checked if it exists, and the thumb
is used/created, otherwise the original code with recursion is used to find
a picture.
Within "2003/200301 Egypt/", I can press a key for directory "2003/200301
Egypt/20030102 Abu Simbel" and ".directory.thumb.txt" is written with
"20030102 Abu Simbel". The same applies when going back.
At "2003/200301 Egypt/" the "want-this-pic.tiff" is used.

I only need to take care I have a backup of all ".directory.thumb.txt".

The code above sure has some parts which can be reused. Also my algorithm
can sit nicely next to the *highlight* code.

At the end of the month I have time to program my algorithm and would be
pleased to hear other thoughts/algorithms.

Angela




More information about the mythtv-users mailing list