3
# Copyright 2007 Erlend Davidson <Erlend.Davidson@gmail.com>
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU Library General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
# modified by David D Lowe <DavidDLowe.flimm@gmail.com>, all his changes are released
20
# into the public domain http://creativecommons.org/licenses/publicdomain/
24
# ooo-thumbnailer file outfile
26
# command line parameters
31
test -f ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs
33
if [ `dirname $ifile` != ${XDG_TEMPLATES_DIR:-$HOME/Templates} ]; then
34
if [ -e /usr/bin/convert ]; then
35
unzip -p "$ifile" Thumbnails/thumbnail.png | convert - +matte "png:$ofile" #-scale "$sizex$size"
37
cache=${XDG_CACHE_HOME:-$HOME/.cache}
39
unzip "$ifile" Thumbnails/thumbnail.png -d "${cache}"
40
totem-gstreamer-video-thumbnailer "${cache}/Thumbnails/thumbnail.png" "$ofile" -s $size
42
# uncomment the following line to include the OpenOffice.org logo in the thumbnail, requires imagemagick
43
#composite -gravity SouthEast /usr/share/icons/hicolor/48x48/mimetypes/openofficeorg3-oasis-text.png "$ofile" "$ofile"