From 45f0edd74658f39e7ed1e61e5159f7fdb58a497d Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 6 Dec 2023 11:51:22 -0600 Subject: Correctly generate screenshots. Previous versions of this script generated (and overwrote) screenshots for each aspect ratio, so the last one would be kept. This was incorrect. For now, screenshots are hard-coded as 8:5 ratio 200 scale (400x250) images. --- prepare | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/prepare b/prepare index b1c3aa1..4cf6843 100755 --- a/prepare +++ b/prepare @@ -103,12 +103,13 @@ TYPE="jpg"; # Table rows MUST BE SORTED FROM GREATEST TO LEAST. # MAKE=$(grep -v ^# </dev/null; done - - # screenshot - printf " - Generating screenshot\n"; - gm convert "${image}/${from_x}x${from_y}.png" -resize 400x250^ "${KEEP}"/${name}/screenshot.jpg 2>/dev/null; done } @@ -418,6 +414,17 @@ printf "%s\n" "${MAKE}" | while read k; do done +#--------------------------------------------------------------- +# output: screenshots +#--------------------------------------------------------------- + +find "${TEMP}"/generated -mindepth 1 -maxdepth 1 -type d | sort | while read k; do + name=$(printf "%s\n" "${k}" | cut -d/ -f3); # sloppy, sorry + printf "Generating screenshot ('%s')...\n" "${KEEP}/${name}/screenshot.jpg"; + gm convert "${k}"/1600x1000.png -resize 400x250^ "${KEEP}"/${name}/screenshot.jpg 2>/dev/null; +done + + #--------------------------------------------------------------- # output: metadata #--------------------------------------------------------------- -- cgit v1.2.3-70-g09d2