Skip to content

Instantly share code, notes, and snippets.

@dhornbein
Created October 10, 2012 21:51
Show Gist options
  • Save dhornbein/3868702 to your computer and use it in GitHub Desktop.
Save dhornbein/3868702 to your computer and use it in GitHub Desktop.
Shell script that takes two arguments a size and name to produce a placeholder image
#!/bin/bash
# This script will tcreate a place holder image
if [ -z "$1" ]
then
echo "Please enter the size you wish to make (ex: 120x300) then press [ENTER]"
read size
else
size=$1
fi
if [ -z "$2" ]
then
label=$size
else
label=$2
fi
convert -background lightgrey -fill darkgrey -size $size -gravity center label:"$label" ./placehold-$label.jpg
echo "$PWD/placehold-$label.jpg - success!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment