2016-04-01 14:05:15 +00:00
|
|
|
#!/usr/bin/sh
|
2016-04-05 12:49:19 +00:00
|
|
|
|
|
|
|
# Aseprite Desktop Integration Module
|
|
|
|
# Copyright (C) 2016 Gabriel Rauter
|
|
|
|
#
|
2016-04-05 22:15:40 +00:00
|
|
|
# Licensed under the the MIT License (https://opensource.org/licenses/MIT).
|
2016-04-05 12:49:19 +00:00
|
|
|
|
2016-04-01 14:05:15 +00:00
|
|
|
if [ $# -ge 2 -a $# -lt 4 ]; then
|
|
|
|
mkdir -p /tmp/Aseprite
|
|
|
|
filename=${1//\//.}$RANDOM
|
|
|
|
if [ $# -eq 2 ]; then
|
|
|
|
aseprite -b --frame-range "0,0" $1 --sheet /tmp/Aseprite/$filename.png
|
|
|
|
elif [ $# -eq 3 ]; then
|
|
|
|
aseprite -b --frame-range "0,0" $1 --shrink-to "$3,$3" --sheet /tmp/Aseprite/$filename.png
|
|
|
|
fi
|
2016-04-04 22:40:01 +00:00
|
|
|
mkdir -p $(dirname "$2"); mv /tmp/Aseprite/$filename.png $2;
|
2016-04-01 14:05:15 +00:00
|
|
|
else
|
2016-04-28 17:47:53 +00:00
|
|
|
echo "Parameters for aseprite thumbnailer are: inputfile outputfile [size]"
|
2016-04-01 14:05:15 +00:00
|
|
|
fi
|