Skip to content

Instantly share code, notes, and snippets.

@dylanpyle
Last active December 21, 2015 03:59
Show Gist options
  • Save dylanpyle/6246199 to your computer and use it in GitHub Desktop.
Save dylanpyle/6246199 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo -n "Source file pattern (e.g. ~/photos/*.jpg): "
read source_pattern
echo -n "Destination path: "
read destination
destination=`eval echo $destination` # Expand to absolute path
echo -n "Desired scale (e.g. 1920x1080): "
read scale
for f in $source_pattern
do
convert $f -resize $scale'^' -extent $scale $destination/`basename $f`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment