[MINC-development] MINC previews in nautilus.

Mishkin Derakhshan mishkind at gmail.com
Tue May 17 15:35:28 EDT 2011


Hi Andrew,

Didn't work for me. Here is my debugging info:

opus[~]$ uname -a
Linux opus 2.6.24-24-generic #1 SMP Tue Aug 18 16:22:17 UTC 2009
x86_64 GNU/Linux

opus[/etc]$ cat debian_version
lenny/sid

opus[~]$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 8.04.3 LTS
Release:	8.04
Codename:	hardy


On Tue, May 17, 2011 at 1:55 AM, Andrew Janke <a.janke at gmail.com> wrote:
> Figured why can't we have these too...
>
> So for the brave using nautilus (gnome file manager) try this
>
> 1. give MINC a mime type:
>
> cai-harold:minc-thumbnailer$ cat x-minc.xml
> <?xml version="1.0" encoding="utf-8"?>
> <mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info"
> type="application/x-minc">
>  <!--Created automatically by update-mime-database. DO NOT EDIT!-->
>  <comment>MINC file</comment>
>  <glob pattern="*.mnc"/>
> </mime-type>
>
> 2. Copy it to:
>
>   $HOME/.local/share/mime/application

I didn't have this directory. I had:
opus[~/.local/share]$ ll
total 20K
drwx------ 4 mishkin cta     4.0K 2009-09-09 17:21 Trash
drwxr-xr-x 2 mishkin cta     4.0K 2009-09-12 19:47 desktop-directories
drwxr-xr-x 3 mishkin mishkin 4.0K 2011-03-08 10:38 tracker
drwxr-xr-x 2 mishkin cta     4.0K 2011-05-05 13:46 applications


I created mime/application and put it in there.
>
> 3. Let xdg know about it:
>
>   $ update-mime-database $HOME/.local/share/mime

opus[~/.local/share/mime/application]$ update-mime-database
/home/mishkin/.local/share/mime/
Directory '/home/mishkin/.local/share/mime/packages' does not exist!

I created mime/packages and it worked.

>
> 4. Test it:
>
>   $ xdg-mime query filetype ~/data/me/a.mnc
>   application/x-minc
>

opus[~]$ xdg-mime query filetype data/cube.mnc
application/octet-stream

opus[~]$ file data/cube.mnc
data/cube.mnc: NetCDF Data Format data

I did the rest of the steps but was unable to bask in any glory.

> 5. create the gnome gconf magic
>
>   $ gconftool-2 -s
> /desktop/gnome/thumbnailers/application at x-minc/command -t string
> "/usr/bin/minc-thumbnailer %u %o"
>   $ gconftool-2 -s
> /desktop/gnome/thumbnailers/application at x-minc/enable -t boolean true
>
> 6. create /usr/bin/minc-thumbnailer:
>
> #! /bin/sh
> #
> # MINC file previewer
> #
> # Andrew Janke - a.janke at gmail.com
>
> USAGE="[OPTION] <input> <output>
>  -h, -?   print this message"
>
> if [ $1 = "-h" ]
> then
>   echo -e usage: $0 "$USAGE" >&2
>   exit 1
> fi
>
> infile=${1#file://}
> outfile=$2
>
> export PATH=$PATH:/usr/local/bic/bin
>
> /usr/local/bic/bin/mincpik -triplanar -tilesize 100 \
>   -horizontal -sagittal_offset_perc 10 "$infile" "png:$outfile"
>
> 7. Now you might have to clear out all the old cached pngs from when
> nautilus failed to create pngs from MINC files in the past and
> couldn't as it didn't know how:
>
>   $ rm -f $HOME/.thumbnails/fail/gnome-thumbnail-factory/*
>
> 8. restart nautilus:
>
>   $ nautilus -q
>
> 9. Go to a directory with .mnc files in it and bask in your glory.
>
> YMWV and if I can get this to work fairly consistently I will include
> it in the mincbundle ubuntu package.  ie: PLEASE PLEASE test this.
> I'll upload the various bits and pieces to github soon.
>
>
>
>
> a
>
> refs:
> http://wiki.ubuntuusers.de/OpenDocument_Thumbnails
> http://jens.triq.net/thumbnail-spec/index.html
> _______________________________________________
> MINC-development mailing list
> MINC-development at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-development
>


More information about the MINC-development mailing list