[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

tgif thumbnailers not working



Hi,

I have been trying unsuccessfully to convince Nautilus to display thumbnails of tgif (*.obj) files. I repeated the steps given in  Romano's blog: http://rlog.rgtti.com/2011/11/24/xfig-thumbnailers-with-gnome3nautilus3/ and created files: /usr/bin/tgif-thumbnail (with executing permission) and /usr/share/thumbnailers/tgif.thumbnailer -- their contents is below. The xdg-mime confirms that the type of *.obj files is application/x-tgif. In gconf-editor I can see that /desktop/gnome/thumbnailers/application@x-tgif/command is set to "/usr/bin/tgif-thumbnailer -s %s %u %u" and /desktop/gnome/thumbnailers/application@x-tgif/enable is checked. Calling tgif-thumbnailer manually:
tgif-thumbnailer -s 128 file://myfile.obj myfile.png 
produces a little PNG image in the current directory. But still no thumbnails, only generic icons in Nautilus. Does anybody have a suggestion what else should I do? Thanks for your time and help!

Tad

/usr/bin/tgif-thumbnailer
--------------------
 #/!bin/sh

# The script will be called with parameters : -s %s %u %o
# %i: input file, %o: output file, %s: size

size=128

if [ $1 = "-s" ]; then
        shift
        size=$1
        shift
fi

dir="/tmp/"
infile="$1"
# use the magic of POSIX variables
infile=${infile#file://*}
tmppng="$dir"${infile%.*}.png
outfile="$2"

# remove file if something strange happens
trap 'rm -rf $tmppng' INT EXIT TERM

die() {
  echo >&2 "$@"
  rm -rf $tmppng
  exit 1
}

tgif -print -quiet -png -color -o/tmp "$infile" || die "tgif failed"
convert  $tmppng -resize $size -sharpen 3 \
          $outfile || die "convert failed"
rm -rf $tmppng
exit 0


/usr/share/thumbnailers/tgif.thumbnailer
--------------------------
[Thumbnailer Entry]
TryExec=/usr/bin/tgif-thumbnailer
Exec=/usr/bin/tgif-thumbnailer -s 128 %u %o
MimeType=application/x-tgif;


Reply to: