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