Photo publication to Pelican

Wed 18 December 2024

I keep all our family pictures on a Buffalo NAS and access via the tool Digikam. Digikam lets me tag, mark faces, rate and annotate photos. I routinely export 5 star photos to a backgrounds folder that each machine on the internal network can access to rotate background photos. In Windows that the background view and on the webTV server it is used for a photo slideshow when idle.

The new 'itch' is to make photos in the NAS storage available on the Linnode (drhorrible) that runs this pelican blog website. However, the Linnode has minimal storage, so I don't want to make full size pictures stored on the Linnode. Instead, I'll make a convert script to republishes the photo in a smaller size to the rsync folders between hammer and drhorrible.

On hammer, the service mount /srv/thumbs_sync is rsync'ed with a cron job to the /var/html/www/schwols.com/public_html/photos folder.

Two requirements are clear. First, the folder structure on the NAS is quite complicated and deep. I really don't want to reflect this structure in the webserver's directory structure. That would mean typing in longer paths for photos in markdown articles. Instead, I'll make a simpler structure when satisifying the second requirement.

The convert script needs to downsize the photo to a web appropriate size; e.g. width of 320px. The parameters of the script should provide a destination folder and photo name in the conversion.

I'll use the Linux tool 'convert' to change the image size.

I think for a directory structure on the webserver, a category and a year structure is good enough structure to keep too many files appearing in a single directory.

/year e.g. 2023, 2024 should be sufficient for Travel/Trip photos /cooking works for photos needed for food photography /house for house/improvment projects /family for family pictures

So, when reviewing pictures on the /srv/digikam share of the NAS. The webconvert.sh script should run like {{{ webconvert.sh IMG_20241204.jpg [-width 320px] [-dir 2024] [-output ArubaDay1.jpg] }}}

Tags: programming |