Skip to content

Instantly share code, notes, and snippets.

@sumonst21
Created July 20, 2020 04:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sumonst21/723e52c281ef79e1fe2cdcf72ab4db54 to your computer and use it in GitHub Desktop.
Save sumonst21/723e52c281ef79e1fe2cdcf72ab4db54 to your computer and use it in GitHub Desktop.
Check if thumbnail exists else generate resized thumbnail from original image
#! /bin/bash
for filename in *.jpg; do
FILE="thumbnails/$filename"
if [ ! -f "$FILE" ]; then
echo "$FILE does not exist."
convert $filename -resize 90x140! "thumbnails/$filename"
echo "Thumb Generated!"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment