dotfiles/dot_local/bin/executable_smart-resize

21 lines
360 B
Plaintext
Raw Permalink Normal View History

2019-06-08 01:46:49 +02:00
#!/usr/bin/env bash
#
# resize-test.sh
# Copyright (C) 2018 pavle <pavle.portic@tilda.center>
#
# Distributed under terms of the MIT license.
#
echo "Resizing "$1
RES=$(identify -format '%G\n' $1)
XRES=$(echo $RES | cut -d "x" -f1)
YRES=$(echo $RES | cut -d "x" -f2)
if (( XRES > YRES )); then
convert $1 -resize $2x $1
else
convert $1 -resize x$2 $1
2019-06-08 01:46:49 +02:00
fi