infrastructure-presentation.../mkimg.sh

16 lines
346 B
Bash
Raw Permalink Normal View History

2016-11-05 22:18:25 +02:00
#!/bin/bash
img=$1
geom=`identify -quiet -format '%G' img/$img`
width=`echo $geom |cut -d x -f 1`
height=`echo $geom |cut -d x -f 2`
wantedwidth=`echo -e "scale=0\n$height"'*'"1.4"|bc|cut -d . -f 1`
if [ $width -gt $wantedwidth ]; then
cp "img/$img" "$img"
else
convert "img/$img" -gravity center -extent ${wantedwidth}x${height} "$img"
fi