Release - Visual Thumbs - (Create thumbs for subfolders in picture library)

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Photo  Visual Thumbs - (Create thumbs for subfolders in picture library)
Post: #1
http://projects.lanik.org/KodiProject_VisualThumbs.htm

Visual Thumbs

This is my second add-on for KODI, or better yes, a script. It is installed under "programs".

What bothered me with KODI is that it doesn't create thumbnails for all image folders. You see, I have my photos structured under the year/month/date folder structure, and KODI only creates thumbnails for folders on the last level. So that means my years and months are just generic folder icons instead of thumbnails. This plugin takes care of that. It scans all your pictures folders and creates folder.jpg image in each that is not the last level.

Now, I only tested this on 3 level depth. So this should work on levels 3 and lower (2). If you run in on pictures of 1 level depth it simply won't do anything. Never tested with levels greater than 3.

Anyways, just go to programs and run "Visual Thumbs" and it will scan ALL of the folders specified in sources.xml for pictures and create thumbnails for each level...

Available from my repository: Lanik Repo

[Image: kodiplugin_thumbs.jpg]


D.

[Image: donate_button_1.png]
(This post was last modified: 2017-02-01 15:21 by DaLanik.)
find quote
peppe_sr Offline
Posting Freak
Posts: 1,335
Joined: Mar 2006
Reputation: 22
Location: Italia, Sicilia, Siracusa
Post: #2
interesting! i will do a test
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #3
Be sure you have backup Smile Don't worry this doesn't delete anything, it only overwrites "folder.jpg" files if they already exist.... Smile
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #4
Also, it might take a while on slower systems.On my Win 10 P5 maching it takes like 10-15 seconds, bot on my android box it takes a minute.
find quote
peppe_sr Offline
Posting Freak
Posts: 1,335
Joined: Mar 2006
Reputation: 22
Location: Italia, Sicilia, Siracusa
Post: #5
i works on lan? i have photos on a nas.
i'm having this script error
Code:
15:06:30 T:632  NOTICE: THUMBS >> PICTURES PATH NR: 1 >>smb://NSA325-V2/photo/Foto/<<
15:06:30 T:632  NOTICE: THUMBS >> TOTAL PATHS FOUND: >>1<<
15:06:30 T:632   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: max() arg is an empty sequence
                                            Traceback (most recent call last):
                                              File "C:\Users\Peppe\AppData\Roaming\Kodi\addons\script.visual_thumbs\addon.py", line 237, in <module>
                                                scanPaths( path )
                                              File "C:\Users\Peppe\AppData\Roaming\Kodi\addons\script.visual_thumbs\addon.py", line 158, in scanPaths
                                                xbmc.log("THUMBS >> BEGIN PATH: >>" + path + "<< FOLDERS IN PATH: >>" + str(objects) + "<< MAX LEVELS: >>" + str(max(countlevel)) + "<<" )
                                            ValueError: max() arg is an empty sequence
                                            -->End of Python script error report<--
you can see my smb share, under "foto" i have year/date/
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #6
To tell the truth, didn't test it with SMB shares, only local drives in Win and Android... Will have a look. Thanx.
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #7
Just tested it and it works with 2 levels but fails with the same error on SMB share on my PC as well.... so it should be reproducable and fixable Wink Back to drawing board Smile
find quote
peppe_sr Offline
Posting Freak
Posts: 1,335
Joined: Mar 2006
Reputation: 22
Location: Italia, Sicilia, Siracusa
Post: #8
ok, when you are ready i'm here to test again.
Peppe
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #9
Found the error - just have to remove the smb: at the beginning and it works. Will upload over weekend.
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #10
OK, it should be updated in the repository, v1.1
find quote
peppe_sr Offline
Posting Freak
Posts: 1,335
Joined: Mar 2006
Reputation: 22
Location: Italia, Sicilia, Siracusa
Post: #11
i'm here, addon updated but i think there is something strange with names of my folders.
addon starts, i confirm with yes the scan request the "working" popup appers in confluence and it stay there in a loop.
in the log i found this
Code:
20:47:50 T:6456  NOTICE: THUMBS >> PATH: >>//NSA325-V2/photo/Foto/2001\07-27-2001_Minareto<<
20:47:51 T:6456  NOTICE: THUMBS >> PATH: >>//NSA325-V2/photo/Foto/2001\09-02-2001_Yaris<<
20:47:51 T:6456   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\xf2' in position 60: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "C:\Users\Peppe\AppData\Roaming\Kodi\addons\script.visual_thumbs\addon.py", line 243, in <module>
                                                scanPaths( path )
                                              File "C:\Users\Peppe\AppData\Roaming\Kodi\addons\script.visual_thumbs\addon.py", line 175, in scanPaths
                                                xbmc.log("THUMBS >> PATH: >>" + root + "<<" )
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\xf2' in position 60: ordinal not in range(128)
                                            -->End of Python script error report<--
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #12
You probably have some "non standard" characters in file or folder name, I'll have a look

Yes, this is probalby it: ò
(This post was last modified: 2016-06-26 16:59 by DaLanik.)
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #13
OK, new version is in repo, tried foldername with ò character and it works....
find quote
peppe_sr Offline
Posting Freak
Posts: 1,335
Joined: Mar 2006
Reputation: 22
Location: Italia, Sicilia, Siracusa
Post: #14
good morning, i tried new versiont.
it started scan and create a couple of folder.jpg, have to say that i haven't understood the scan order. surely it is not alphabetical.
after a while, i have lots of pictures and folders to scan, looking the log i found an error about some type of unkown kind of image.
if the error is in the latest folder shown in the log before the error appears i could say that the pics in that folder are normal .jpg
i can't post the log ATM but i will in next hours.
Peppe
find quote
DaLanik Offline
Posting Freak
Posts: 971
Joined: Apr 2016
Reputation: 34
Location: Prague, CZ
Post: #15
You are a good source for bug fixes Smile Smile Smile
find quote
Post Reply