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/*
@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