Skip to content

Instantly share code, notes, and snippets.

@hupili
Created December 3, 2015 16:05
Show Gist options
  • Save hupili/507facaf96c6ad7c2e58 to your computer and use it in GitHub Desktop.
Save hupili/507facaf96c6ad7c2e58 to your computer and use it in GitHub Desktop.
Generate Icons for Weibo. (Resize images by imagemagick)
#!/bin/bash
if [[ $# != 1 ]]; then
echo "usage: $0 fn_input"
exit 255
else
fn_input=$1
fi
ext="${fn_input##*.}"
fn="${fn_input%.*}"
echo "fn:" $fn
echo "ext:" $ext
for scale in "16x16" "80x80" "120x120"
do
echo $scale
convert $fn_input -geometry $scale ${fn}-${scale}.${ext}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment