Skip to content

Instantly share code, notes, and snippets.

@oimou
Created April 8, 2015 06:42
Show Gist options
  • Save oimou/7fd554e36d1b2a238371 to your computer and use it in GitHub Desktop.
Save oimou/7fd554e36d1b2a238371 to your computer and use it in GitHub Desktop.
function iconify {
filepath=$1
directory_name=`dirname ${filepath}`
filename=`basename ${filepath}`
filename_without_extension=${filename%.*}
extname=${filename##*.}
newfilename=${directory_name}/${filename_without_extension}-128x128.${extname}
convert -resize 128x128 $1 ${newfilename}
}
@oimou
Copy link
Author

oimou commented May 8, 2015

Usage: iconify FILENAME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment