2016-04-01 16:05:15 +02:00
|
|
|
#!/usr/bin/sh
|
2016-04-05 14:49:19 +02:00
|
|
|
|
|
|
|
# Aseprite Desktop Integration Module
|
|
|
|
# Copyright (C) 2016 Gabriel Rauter
|
|
|
|
#
|
2016-04-05 23:09:02 +02:00
|
|
|
# Dual licensed under the MIT and GPL 2 licenses.
|
|
|
|
#
|
2016-04-05 14:49:19 +02:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License version 2 as
|
2016-04-05 23:09:02 +02:00
|
|
|
# published by the Free Software Foundation or the MIT License
|
|
|
|
# (https://opensource.org/licenses/MIT).
|
2016-04-05 14:49:19 +02:00
|
|
|
|
2016-04-01 16:05:15 +02: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-05 00:40:01 +02:00
|
|
|
mkdir -p $(dirname "$2"); mv /tmp/Aseprite/$filename.png $2;
|
2016-04-01 16:05:15 +02:00
|
|
|
else
|
|
|
|
echo "Parameters for aseprite thumbnailer are: inputfile outputfile [size]"
|
|
|
|
fi
|