Script for making thumbnail images (makeThumbs.sh)

Version 1.1 by Normann P. Nielsen on 2026/11/15 15:43

This script travles a directory structure and creates thumbnails for each image and video (flv, avi, mov)

Warning

This script requires Imagick and ffmpegthumbnailer installed, this can typically be done with a package manager for the OS.

Base for search is hardcoded in the script as /data/images

Thumbnails are places below an image in a relative subdir called "thumbs/200pxHigh - If the Height Parameter is 200. eg. "thumbs/800pxHigh - If the Height Parameter is 800. Se "Directory Structure samples" below.

Image names are kept, movies get a ".jpg" appended to their filename

Success

This Script is closely related to (hence used as part of) the:

Script for linking images into a Confluence page (updateGallery.sh)

Executing the script:

./makeThumbs.sh height=200 startdir=/images quality=80 labelheight=10

Parameters:

 Height Height of the thumbnails
 StartDir The Directory to start from
 Quality The Quality of the converted image, lower value = smaller size

Source of the Script: https://bitbucket.org/moseiseydk/confluence-gallery/src/1ccb4aa93b95d321c7d5c29ea776f799819bc6d0/makeThumbs.sh?at=master

Directory structure sample:

 Original file Thumbnail for 200 Height Thumbnail for 800 Height  
 /data/images/MyCar/image1.jpg /data/images/MyCar/thumbs/200pxHigh/image1.jpg /data/images/MyCar/thumbs/800pxHigh/image1.jpg  
 /data/images/MyCar/Styled/image1.jpg /data/images/MyCar/Styled/thumbs/200pxHigh/image1.jpg /data/images/MyCar/Styled/thumbs/800pxHigh/image1.jpg  
 /data/images/MyCar/Speeding.avi /data/images/MyCar/thumbs/200pxHigh/Speeding.avi.jpg