0Display photo info in Kodi slideshow screensaver

I have a large photo col­lec­tion with lots of metadata that I wanted the kodi slideshow screensaver to dis­play. With lots read­ing, exper­i­ment­ing, and tri­al-and-error, I’ve finally got a reas­on­able sys­tem that shows what I was hop­ing for.

The main file for the slideshow screensaver is loc­ated (on win­dows) in \Users\%Username%\AppData\Roaming\Kodi\addons\screensaver.picture.slideshow\resources\lib and is called gui.py

If you know some python you can make all kinds of modi­fic­a­tions to this file. Below are what I made to show inform­a­tion about the author, cam­era, and where and when the pic­ture was taken. I get the loc­a­tion from the folder name as I keep all my pho­tos in a folder with an 8‑character date at the start (YY-MM-DD) fol­lowed by the place or event name.

after line 163, added the fol­low­ing null val­ues for cam­era and author

camera = 'unknown camera'
artist = 'unknown'

after line 173, added the fol­low­ing to get the cam­era and author from exif

if exiftags.has_key('Image Model'):
  camera = str(exiftags['Image Model']).decode('utf-8')
if exiftags.has_key('Image Artist'):
  artist = str(exiftags['Image Artist']).decode('utf-8')

changed line 183 to start the pro­cess or reformat­ting the date

time = datetime{10:].split(':')

replaced line 187 to cre­ate a bet­ter format­ted date

if date[1] == '01':
  date[1] = 'Jan'
elif date[1] == '02':
  date[1] = 'Feb'
elif date[1] == '03':
  date[1] = 'Mar'
elif date[1] == '04':
  date[1] = 'Apr'
elif date[1] == '05':
  date[1] = 'May'
elif date[1] == '06':
  date[1] = 'Jun'
elif date[1] == '07':
  date[1] = 'Jul'
elif date[1] == '08':
  date[1] = 'Aug'
elif date[1] == '09':
  date[1] = 'Sept'
elif date[1] == '10':
  date[1] = 'Oct'
elif date[1] == '11':
  date[1] = 'Nov'
elif date[1] == '12':
  date[1] = 'Dec'
datetime = date[2] + '-' + date[1] + '-' + date[0] + ' at' + time[0] + ':' + time[1]

replaced line 228 to out­put the new data

ROOT, FOLDER = os.path.split(os.path.dirname(img[0]))
galname = FOLDER
if (galname or 'x')[1].isdigit():
   galname = FOLDER[9:]
self.datelabel.setLabel(galname + '.  Taken with ' + camera + ' on ' + datetime + '.  (c) ' + artist + '.')

Leave a Reply