Kodi Community Forum

Full Version: Shell script to create pictures thumbnails offline
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
You might have seen some of my posts w.r.t. offline creation of thumbnails for jpg pictures. My main kodi host, a raspberry pi3, has not enough compute power to create the thumbnails "fast" enough. Thus I have written a short shell script using sqlite3 and ImageMagick to create all thumbnails offline on a more powerful (linux) host.

This script has two major disadvantages - any filename below you pictures directory must not contain white space characters (a typical limitation for shell scripting), and as a bash shell script it will run only an a linux host.

In my environment I have a 2TB drive connected to my raspi, shared by NFS. It contains the Thumbnails folder and Texture13.db. I access those files by NFS from my linux host. Since sqlite3 does not easily support NFS, my script works on a local copy of Textures13.db and will copy it back when finished.

Just in case my script creates a backup copy of Texture13.db.

My script does have prototype character (not fool proven, no performance optimization). But since I myself plan to run it more or less only once (for my whole pictures library I do not plan major improvements.

But of cause use my script at your own risk.

Since I do not maintain any github project, I've uploaded my script via hastebin: MyThumb.sh

Store the data as file MkThumb.sh and make it executable by chmod 755 MkThumb.sh

For more details look into the script itself.

Hope it might be helpful for somebody.

Regards, Michael