aseprite/desk/aseprite-thumbnailer
Gabriel Rauter 75445d0b67 add linux thumbnailers for Gnome & KDE/Qt
This adds thumbnailer support both for Gnome and KDE5/Qt5. The gnome
thumbnailer is installed by default on linux systems, as it does not add
any additional dependencies at build time and can be used by
GnomeThumbnailFactory. The KDE/Qt thumbnailer need the whole Qt and Kio
stack to build, as well as the distribution dependend variables set.
Because of that it is not build by default. For the thumnailers to work
for all of aseprites supported file formats and additonal mime type file
is installed. Packagers in addition need to call update-mime-database
path-to-mime-database (/usr/share/mime for example) as post install
command.
2016-04-04 23:50:14 +02:00

14 lines
475 B
Bash
Executable File

#!/usr/bin/sh
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
mkdir -p $(dirname "$2"); mv /tmp/Aseprite/$filename.png $2;
else
echo "Parameters for aseprite thumbnailer are: inputfile outputfile [size]"
fi