Use mktemp for tempfile and allow out-of-aspect resizing

master
Brainwrecked Tech 5 years ago
parent 2c857b2a93
commit 7451e358bd

@ -21,7 +21,7 @@ for SIZE in $((DIMS[0] - WIDESORT[0])) $((DIMS[0] + WIDESORT[0])); do
(( SIZE > 0 && (SIZE & (SIZE - 1)) == 0 )) && RESIZE=${SIZE}
done
set -x
convert "${1}" -resize ${RESIZE}x${RESIZE} /tmp/tmp.png
png2icns ${1/%png/icns} /tmp/tmp.png
rm /tmp/tmp.png
TEMPFILE=$(mktemp)
convert "${1}" -resize ${RESIZE}x${RESIZE}\! ${TEMPFILE}
png2icns ${1/%png/icns} ${TEMPFILE}
rm ${TEMPFILE}

Loading…
Cancel
Save