Skip to content

Instantly share code, notes, and snippets.

@masaedw
Created August 2, 2017 10:55
Show Gist options
  • Save masaedw/a493f80bbd94e7b1fe33f885a349c681 to your computer and use it in GitHub Desktop.
Save masaedw/a493f80bbd94e7b1fe33f885a349c681 to your computer and use it in GitHub Desktop.
#!/bin/bash
name=$1
dir=$(basename $name .jpg)
if [[ ! -d $dir ]]; then
mkdir $dir
fi
for i in 1040 1024 700 460 300 240; do
convert -resize ${i}x -format jpeg $1 $dir/$i
done
mv $dir/1024 $dir/1024.jpg
cp $dir/240 $dir/240.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment