#!/bin/bash # # generate-images # jms1 2023-07-09 # # - Run the scripts to generate the template images # - Create small versions of each image, to show in the generated pages set -ex ############################################################################### # # Create a small version of an image function make_small { FILE="$1" FILE_SM="${FILE%.png}-sm.png" WORK="$( mktemp )" ######################################## # Create a small version of the image cp "$FILE" "$WORK" mogrify -scale 20% "$WORK" ######################################## # Add a black 1px border to the small image magick "$WORK" \ -background black \ -gravity northwest -splice 1x1 \ -gravity southeast -splice 1x1 \ "$FILE_SM" rm -f "$WORK" } ############################################################################### ############################################################################### ############################################################################### rm -f *.png ######################################## # Basic templates ./rm2-template-basic make_small dots-50.png make_small basic-page.png make_small daily-work.png ######################################## # Cover page ./rm2-template-cover make_small cover-simple.png ######################################## # Calendar images for H in r l do for O in P L do FILE="$O-CalendarMo-${H}h.png" ######################################## # Generate the actual template file rm2-template-calendar -$H -$O -o "$FILE" ######################################## # Create a small version of the template make_small "$FILE" done done ######################################## # Focus notes ./rm2-template-focus-notes make_small focusnotes.png