Nikon raw images on Ubuntu 12.04

Since switching to Ubuntu 12.04 sometime last year I have not been able to see thumbnails of images shot in raw format. Specifically I have a Nikon camera that shoots NEF files which even after installing various tools such as UFRaw still did not work. Eventually I wrote a small bash script for converting NEF to PNG so I could see what the image was without having to open each one in UFRaw first. 

Not the perfect solution but done the job for a while. I have since stumbled on a bug on Launchpad which is the same issue and affecting a lot of people. Luckily there is a work around or simple fix (which should just be done when installing these tools).

First off make sure to install gnome-raw-thumbnailer which might resolve the problem out the gate. To check if it is working just open a folder with raw images or refresh if already there. The thumbnails should be generated without having to restart anything.

sudo apt-get install gnome-raw-thumbnailer

If that still does not generate thumbnails you are probably missing the configuration. Here is one I found that makes use of ufraw-batch to generate the thumbnails

[Thumbnailer Entry]
Exec=/usr/bin/ufraw-batch --embedded-image --out-type=png --size=%s %u --overwrite --silent --output=%o
MimeType=image/x-3fr;image/x-adobe-dng;image/x-arw;image/x-bay;image/x-canon-cr2;image/x-canon-crw;image/x-cap;image/x-cr2;image/x-crw;image/x-dcr;image/x-dcraw;image/x-dcs;image/x-dng;image/x-drf;image/x-eip;image/x-erf;image/x-fff;image/x-fuji-raf;image/x-iiq;image/x-k25;image/x-kdc;image/x-mef;image/x-minolta-mrw;image/x-mos;image/x-mrw;image/x-nef;image/x-nikon-nef;image/x-nrw;image/x-olympus-orf;image/x-orf;image/x-panasonic-raw;image/x-pef;image/x-pentax-pef;image/x-ptx;image/x-pxn;image/x-r3d;image/x-raf;image/x-raw;image/x-rw2;image/x-rwl;image/x-rwz;image/x-sigma-x3f;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-sr2;image/x-srf;image/x-x3f;