Skip to content

Instantly share code, notes, and snippets.

@TheLinx
Created October 2, 2010 23:59
Show Gist options
  • Save TheLinx/608125 to your computer and use it in GitHub Desktop.
Save TheLinx/608125 to your computer and use it in GitHub Desktop.
#!/bin/bash
function _findres_it {
local it=2
while [ 1 ]; do
if [ $it -gt $itval ]; then
itval=$it
break
fi
it=$(($it*2))
done
}
function findres {
itval=$1
_findres_it
width=$itval
itval=$2
_findres_it
height=$itval
}
for n in $@; do
findres `identify -format "%w %h" $n`
mogrify -background transparent -gravity northwest -extent ${width}x${height} $n
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment