~flimm/ooo-thumbnailer/releases

« back to all changes in this revision

Viewing changes to ooo-thumbnailer

  • Committer: David D Lowe
  • Date: 2009-03-18 17:11:01 UTC
  • mto: This revision was merged to the branch mainline in revision 2.
  • Revision ID: daviddlowe.flimm@gmail.com-20090318171101-n1bb8rn3s9ivwldp
Fixed overwrite bug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
# documents in the Templates directory are ignored
34
34
if [ `dirname $ifile` != ${XDG_TEMPLATES_DIR:-$HOME/Templates} ]; then
35
35
  if [ -e /usr/bin/convert ]; then
36
 
    unzip -p "$ifile" Thumbnails/thumbnail.png | convert - +matte -scale ${size}x${size} "png:$ofile"
 
36
    if [ "$size" == "" ]; then
 
37
      unzip -p "$ifile" Thumbnails/thumbnail.png | convert - +matte "png:$ofile"
 
38
    else
 
39
      unzip -p "$ifile" Thumbnails/thumbnail.png | convert - +matte -scale ${size}x${size} "png:$ofile"
 
40
    fi
37
41
  else
38
42
    cache=${XDG_CACHE_HOME:-$HOME/.cache}
39
43
    mkdir -p "$cache"
40
 
    unzip "$ifile" Thumbnails/thumbnail.png -d "${cache}"
41
 
    totem-gstreamer-video-thumbnailer "${cache}/Thumbnails/thumbnail.png" "$ofile" -s $size
 
44
    unzip -o "$ifile" Thumbnails/thumbnail.png -d "${cache}"
 
45
    if [ "$size" == "" ]; then
 
46
      totem-gstreamer-video-thumbnailer "${cache}/Thumbnails/thumbnail.png" "$ofile"
 
47
    else
 
48
      totem-gstreamer-video-thumbnailer "${cache}/Thumbnails/thumbnail.png" "$ofile" -s $size
 
49
    fi
42
50
  fi
43
51
  # uncomment the following line to include the OpenOffice.org logo in the thumbnail, requires imagemagick
44
52
  #composite -gravity SouthEast /usr/share/icons/hicolor/48x48/mimetypes/openofficeorg3-oasis-text.png "$ofile" "$ofile"