Skip to content

Instantly share code, notes, and snippets.

@h4cc
Last active November 28, 2022 12:53
Show Gist options
  • Star 38 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save h4cc/13450db3d4a7457f9b38 to your computer and use it in GitHub Desktop.
Save h4cc/13450db3d4a7457f9b38 to your computer and use it in GitHub Desktop.
Getting Thumbnails / Previews of your RAW files in Ubuntu

Howto

Install these programms

sudo apt-get install gnome-raw-thumbnailer ufraw-batch

Try now if everything works, and your thumbnails show up. If not, try the following part.

Fixing missing mime types

In case the default config does not work for you, try this:

Edit the file /usr/share/thumbnailers/raw.thumbnailer as root and insert the following content:

[Thumbnailer Entry]
TryExec=ufraw-batch
Exec=ufraw-batch --silent --size %s --out-type=png --noexif --output=%o --overwrite --embedded-image %i
MimeType=image/x-canon-cr2;image/x-canon-crw;image/x-minolta-mrw;image/x-nikon-nef;image/x-pentax-pef;image/x-panasonic-raw2;image/x-samsung-srw;image/x-olympus-orf;

Check if the mime type of your RAW images in in the MimeType list.

After that, stop nautlius and clear the thumbnail caches:

nautilus -q
rm -rf .cache/thumbnails/* .thumbnails/*
@manuhortet
Copy link

Hey, works fine on Ubuntu 18.04 too! 👍

@rstrube
Copy link

rstrube commented May 26, 2018

Doesn't seem to work with olympus .orf files. Any ideas? I've tried both the gnome-raw-thumbnailer and ufraw-batch thumbnailers. The gnome-raw-thumbnailer generates black previews and the ufraw-batch does not appear to generate any previews.

Also see this (another person has the same problem): https://ubuntuforums.org/showthread.php?t=2392682

@mhussajn
Copy link

mhussajn commented May 28, 2018

Doesn't work form me (ubuntu 18.04)
gnome-raw-thumbnailer standalone works, but is painfully slow, after installing ufraw-batch it does not generate any previews,

uninstalling gnome-raw-thumbnailer didn't help either

@eduardocesar
Copy link

Worked for me in nemo on Mint Lmde2 too!

@SethDonohue
Copy link

Awesome! Thanks for this, after editing the raw.thumbnail file it works wonders! Cheers!

@KristijanZic
Copy link

KristijanZic commented Nov 1, 2018

On 18.10 there wasn't any /usr/share/thumbnailers/raw.thumbnailer file. I added one and done everything above mentioned.
It didn't work. It generates thumbnails painfully slowly, at the same speed as gnome-raw-thumbnailer did by itself.

@thomaswhite
Copy link

On 18.10 there wasn't any /usr/share/thumbnailers/raw.thumbnailer file. I added one and done everything above mentioned.
It didn't work. It generates thumbnails painfully slowly, at the same speed as gnome-raw-thumbnailer did by itself.
On 18.10 the file is called gnome-raw.thumbnailer

@origpumu
Copy link

origpumu commented May 20, 2019

sudo apt remove --purge gnome-raw-thumbnailer
sudo apt install ufraw-batch
nautilus -q
rm -rf ~/.cache/thumbnails/*

Place the file /usr/share/thumbnailers/raw.thumbnailer with the given content.

Works like a charm on ubuntu 19.04 also. Thank you!

@hronellenfitsch
Copy link

ufraw has been removed from Ubuntu 19.10. Is there an alternative way to get raw thumbnails?

@xtermi2
Copy link

xtermi2 commented Jan 19, 2020

ufraw has been removed from Ubuntu 19.10. Is there an alternative way to get raw thumbnails?

I'm also interested if there is a solution for 19.10.

@ghalfacree
Copy link

ghalfacree commented Jan 31, 2020

@hronellenfitsch, @xtermi2: Neither ufraw-batch nor gnome-raw-thumbnailer are available in 19.10, but I got raw thumbnails working by editing the gdk-pixbuf thumbnailer's MIME types. Open up /usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer and edit it to read as follows:

[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/png;image/bmp;image/x-bmp;image/x-MS-bmp;image/gif;image/x-icon;image/x-ico;image/x-win-bitmap;image/vnd.microsoft.icon;application/ico;image/ico;image/icon;text/ico;application/x-navi-animation;image/jpeg;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/tiff;image/x-xpixmap;image/x-xbitmap;image/x-tga;image/x-icns;image/x-quicktime;image/qtif;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-panasonic-raw2;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-samsung-srw;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;

If you've a raw.thumbnailer or similar, delete it.

Quit Nautilus and delete the thumbnail cache (or it won't even try to regenerate previously-failed thumbnails) with rm -rf ~/.cache/thumbnails/* then open Nautilus and browse to a directory with raw files in it.

Seems a bit slower than the old ufraw-batch method, but it's working here!

@hronellenfitsch
Copy link

@ghalfacree
Fantastic, this works like a charm! Realling wondering why it isn't the default.

@flolu
Copy link

flolu commented Feb 23, 2020

E: Unable to locate package gnome-raw-thumbnailer
E: Package 'ufraw-batch' has no installation candidate

@ghalfacree
Copy link

@flolu Use the instructions in my comment - you don't need gnome-raw-thumbnailer or ufraw-batch (neither of which is available in newer Ubuntu releases).

https://gist.github.com/h4cc/13450db3d4a7457f9b38#gistcomment-3162296

@flolu
Copy link

flolu commented Feb 23, 2020

Wow. I should have read your comment. Thank you so much!

@daliusd
Copy link

daliusd commented Mar 15, 2020

Using --embedded-image causes Segmentation Fault on Ubuntu (it seems this bug https://bugs.launchpad.net/ubuntu/+source/ufraw/+bug/1768855). You can remove this setting but it will be slower. You might want to add "--rotate=camera" as well.

@kirillkushpel
Copy link

works perfectly on Mint 19.3, cheers!

@PaulBeaudet
Copy link

I know this isn't the point of this post but none of the recommended solutions here seemed to work of Mint 19.1. It does seem like 19.1 mate has the .thumbnailer file that @ghalfacree mentioned. Haven't had a lot of luck with editing it, quitting caja, and removing the cache

@Nithur-M
Copy link

It works. Thank you so much.

@s-gbz
Copy link

s-gbz commented Mar 27, 2021

Confirmed on Pop!_OS 20.10 with GNOME version 3.38.3. Thanks a lot for the easy fix! 🙌 🥳

PS: If you're reading this make sure to follow the instructions provided in the comment (https://gist.github.com/h4cc/13450db3d4a7457f9b38#gistcomment-3162296), because you will encounter E: Package 'ufraw-batch' has no installation candidate otherwise.

@razi006
Copy link

razi006 commented May 2, 2021

Thanks!!! I didn't go far than the main post before and got stuck!!! But it's working now!!!

@rattkin
Copy link

rattkin commented Jun 6, 2021

does not work with Sony A7c raws on Ubuntu 20.04

@ghalfacree
Copy link

does not work with Sony A7c raws on Ubuntu 20.04

Have you tried the approach in my comment? That works for me on Ubuntu 20.04.

@rattkin
Copy link

rattkin commented Jun 6, 2021

does not work with Sony A7c raws on Ubuntu 20.04

Have you tried the approach in my comment? That works for me on Ubuntu 20.04.
Yes, I tried exactly that.

If I run /usr/bin/gdk-pixbuf-thumbnailer with some input and output file, is says
** (gdk-pixbuf-thumbnailer:14225): WARNING **: 21:11:33.733: Could not thumbnail '/home/rattkin/... .ARW': Failed to load TIFF image
I will dig elsewhere

@riquezjp
Copy link

riquezjp commented Jul 27, 2021

does not work with Sony A7c raws on Ubuntu 20.04

Have you tried the approach in my comment? That works for me on Ubuntu 20.04.

Yeah also doesnt work for me with Sony A6000, or Sony Nex, both use x-sony-arw mime type & have embedded jpg, but it doesnt work.
Using Ubuntu 21.04

I think Sony ARW just isnt supported. There is a workaround to use rawtherapee thumbnailer instead (& remove the mine types from pixbuf if you added) here: pop-os/pop#1484

@Chema1024
Copy link

@hronellenfitsch, @xtermi2: Neither ufraw-batch nor gnome-raw-thumbnailer are available in 19.10, but I got raw thumbnails working by editing the gdk-pixbuf thumbnailer's MIME types. Open up /usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer and edit it to read as follows:

[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/png;image/bmp;image/x-bmp;image/x-MS-bmp;image/gif;image/x-icon;image/x-ico;image/x-win-bitmap;image/vnd.microsoft.icon;application/ico;image/ico;image/icon;text/ico;application/x-navi-animation;image/jpeg;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/tiff;image/x-xpixmap;image/x-xbitmap;image/x-tga;image/x-icns;image/x-quicktime;image/qtif;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-panasonic-raw2;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-samsung-srw;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;

If you've a raw.thumbnailer or similar, delete it.

Quit Nautilus and delete the thumbnail cache (or it won't even try to regenerate previously-failed thumbnails) with rm -rf ~/.cache/thumbnails/* then open Nautilus and browse to a directory with raw files in it.

Seems a bit slower than the old ufraw-batch method, but it's working here!

Worked great on Linux Mint 20.2 with dng raws! Thanks!!

@countsudoku
Copy link

@hronellenfitsch, @xtermi2: Neither ufraw-batch nor gnome-raw-thumbnailer are available in 19.10, but I got raw thumbnails working by editing the gdk-pixbuf thumbnailer's MIME types. Open up /usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer and edit it to read as follows:

[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/png;image/bmp;image/x-bmp;image/x-MS-bmp;image/gif;image/x-icon;image/x-ico;image/x-win-bitmap;image/vnd.microsoft.icon;application/ico;image/ico;image/icon;text/ico;application/x-navi-animation;image/jpeg;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/tiff;image/x-xpixmap;image/x-xbitmap;image/x-tga;image/x-icns;image/x-quicktime;image/qtif;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-panasonic-raw2;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-samsung-srw;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;

If you've a raw.thumbnailer or similar, delete it.

Quit Nautilus and delete the thumbnail cache (or it won't even try to regenerate previously-failed thumbnails) with rm -rf ~/.cache/thumbnails/* then open Nautilus and browse to a directory with raw files in it.

Seems a bit slower than the old ufraw-batch method, but it's working here!

To make this even better copy /usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer to ~/.local/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer and make the edit there.

@rebernet
Copy link

rebernet commented Dec 15, 2021

I still cannot get it running with my Sony A7 ARW files on Ubuntu 20.04. I also tried the workaround with the rawtherapee.thumbnailer from here: pop-os/pop#1484.

Has anybody had more success and can maybe share some information?

@TimTrojner
Copy link

Thanks, it works 😄 !
I had to add image/x-fuji-raf; to the end of the raw.thumbnailer, for fuji files.

@Lamera
Copy link

Lamera commented Apr 11, 2022

@rebernet I also don't get it to work with Sony ARW files on Ubuntu 21.10. Would be nice to see thumbnails of my photos in the file manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment