19

No matter what I try (changing the preview options, deleting the thumbnail cache, etc.), Nautilus in Ubuntu 15.04 does not generate thumbnails for GIF image files. However, it generates a thumbnail for all other previewable file type. Can I solve this problem somehow?

1
  • Hm, I cleared ~/.cache/thumbnails and thunar immediately shows thumbnails, but nautilus does not, even though the images meet all criteria for thumbnail rendering (local files, <10MB). This is on Ubuntu 18.04.5. Aug 30, 2021 at 14:52

2 Answers 2

28

Create your own thumbnailer:

sudo nano /usr/share/thumbnailers/gif.thumbnailer 

Add the following content:

[Thumbnailer Entry]
TryExec=convert
Exec=convert %i[0] -resize %sx%s %o
MimeType=image/gif;

Install imagemagick (just in case it's not installed by default):

sudo apt-get install imagemagick

Clear the cache:

rm -r ~/.cache/thumbnails

source

1
3

Note that every thumbnail occupies a variable amount of disk memory. When you open for the first time a folder with images the system will provide to generate the thumbnails; if the folder is full of files you will see that process running until all thumbnails are generated. Once these thumbnails are stored, the next time you will open that folder you won’t see any generation process. Thumbnails in Ubuntu are generated and thus stored in one of the home's folders named .cache while the settings are stored in a root folder. You can check if nautilus is able to show preview by editing the filed in dconf (pay attention cause this can damage your filesystem or mess up your system if misused).

dconf write /org/gnome/nautilus/preferences/show-image-thumbnails '"always"'

for the options (see description in dconf too):

  • always --> will show thumbnaisl even on remote servers (bad for performance)
  • local-only --> will show thumbnails locally on your pc (this is default in ubuntu 18.04)
  • never --> will show only default icons

If an image is larger than 10 MB, no preview will be displayed, but only the default image icon. To fix this behaviour you can increase this limit (doubling for example).

dconf write /org/gnome/nautilus/preferences/thumbnail-limit '"20000000"'

Once you have checked if nautilus is able to do its job you have to create the folder for the thumbnails’ settings if not present:

sudo mkdir /usr/share/thumbnailers/

In this folder you have to create a file named typeoffile.thunbnailer for every type file (or category of file) but first of all you have to install the programs that are necessary to edit and view that type of files. For example if you want to see the thumbnails of pdf you should install a pdf viewer (like evince which is default in ubuntu 18.04) and so further. For raw images install these 2 packages:

sudo apt install gnome-raw-thumbnailer ufraw-batch

For video preview:

sudo apt install ffmpegthumbnailer

After the proper program installation restart nautilus

nautilus -q

Yet you have to clear the thumbnail cache which is stored in your home directory. If you browse to that folder you will find two folders, one for normal thumbnails and one for the large’s one.

rm -r  ~/.cache/thumbnails/*

You could even do this job in a cronjob if you consider the cache generated by thumbnails too big. I post the text of the files that are inside the settings’ folder. Note that this could be different in your system.

gif.thumbnailer

[Thumbnailer Entry]
TryExec=convert
Exec=convert %i[0] -resize %sx%s %o
MimeType=image/gif;

raw.thumbnailer

[Thumbnailer Entry]
TryExec=ufraw-batch
Exec=ufraw-batch --silent --size %s --out-type=png --noexif --output=%o --overwrite --embedded-image %i
MimeType=image/x-adobe-dng;image/x-canon-cr2;image/x-canon-crw;image/x-dcraw;image/x-fuji-raf;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-minolta-mrw;image/x-nikon-nef;image/x-olympus-orf;image/x-panasonic-raw;image/x-pentax-pef;image/x-sigma-x3f;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;
librsvg.thumbnailer
[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/svg+xml;image/svg+xml-compressed; 

evince.thumbnailer

[Thumbnailer Entry]
TryExec=evince-thumbnailer
Exec=evince-thumbnailer -s %s %u %o
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;application/x-ext-pdf;application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;application/x-ext-ps;application/x-ext-eps;application/illustrator;application/x-dvi;application/x-bzdvi;application/x-gzdvi;application/x-ext-dvi;image/vnd.djvu+multipage;application/x-ext-djv;application/x-ext-djvu;image/tiff;application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/x-ext-cbr;application/x-ext-cbz;application/vnd.comicbook+zip;application/x-ext-cb7;application/x-ext-cbt;application/oxps;application/vnd.ms-xpsdocument

gnome-raw-thumbnailer

[Thumbnailer Entry]
TryExec=gnome-raw-thumbnailer
Exec=gnome-raw-thumbnailer -s %s %u %o
MimeType=image/x-adobe-dng;image/x-canon-cr2;image/x-canon-crw;image/x-dcraw;image/x-fuji-raf;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-minolta-mrw;image/x-nikon-nef;image/x-olympus-orf;image/x-panasonic-raw;image/x-pentax-pef;image/x-sigma-x3f;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;

ffmpegthumbnailer.thumbnailer

[Thumbnailer Entry]
TryExec=ffmpegthumbnailer
Exec=ffmpegthumbnailer -i %i -o %o -s %s -f
MimeType=video/jpeg;video/mp4;video/mpeg;video/quicktime;video/x-ms-asf;video/x-ms-wm;

video/x-ms-wmv;video/x-msvideo;video/x-flv;video/x-matroska;video/webm;video/mp2t;

gnome-font-viewer.thumbnailer

[Thumbnailer Entry]
TryExec=gnome-thumbnail-font
Exec=gnome-thumbnail-font --size %s %u %o
MimeType=application/x-font-ttf;application/x-font-pcf;application/x-font-type1;application/x-font-otf;font/ttf;font/otf;

totem.thumbnailer

[Thumbnailer Entry]
TryExec=/usr/bin/totem-video-thumbnailer
Exec=/usr/bin/totem-video-thumbnailer -s %s %u %o
MimeType=application/mxf;application/ogg;application/ram;application/sdp;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.ms-wpl;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;application/x-extension-m4a;application/x-extension-mp4;application/x-flash-video;application/x-matroska;application/x-netshow-channel;application/x-ogg;application/x-quicktimeplayer;application/x-shorten;image/vnd.rn-realpix;image/x-pict;misc/ultravox;text/x-google-video-pointer;video/3gp;video/3gpp;video/3gpp2;video/dv;video/divx;video/fli;video/flv;video/mp2t;video/mp4;video/mp4v-es;video/mpeg;video/mpeg-system;video/msvideo;video/ogg;video/quicktime;video/vivo;video/vnd.divx;video/vnd.mpegurl;video/vnd.rn-realvideo;video/vnd.vivo;video/webm;video/x-anim;video/x-avi;video/x-flc;video/x-fli;video/x-flic;video/x-flv;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-mpeg2;video/x-ms-asf;video/x-ms-asf-plugin;video/x-ms-asx;video/x-msvideo;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-nsv;video/x-ogm+ogg;video/x-theora;video/x-theora+ogg;video/x-totem-stream;audio/x-pn-realaudio;audio/3gpp;audio/3gpp2;audio/aac;audio/ac3;audio/AMR;audio/AMR-WB;audio/basic;audio/dv;audio/eac3;audio/flac;audio/m4a;audio/midi;audio/mp1;audio/mp2;audio/mp3;audio/mp4;audio/mpeg;audio/mpg;audio/ogg;audio/opus;audio/prs.sid;audio/scpls;audio/vnd.rn-realaudio;audio/wav;audio/webm;audio/x-aac;audio/x-aiff;audio/x-ape;audio/x-flac;audio/x-gsm;audio/x-it;audio/x-m4a;audio/x-matroska;audio/x-mod;audio/x-mp1;audio/x-mp2;audio/x-mp3;audio/x-mpg;audio/x-mpeg;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;audio/x-ms-wma;audio/x-musepack;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-wav;audio/x-pn-windows-acm;audio/x-realaudio;audio/x-real-audio;audio/x-s3m;audio/x-sbc;audio/x-shorten;audio/x-speex;audio/x-stm;audio/x-tta;audio/x-wav;audio/x-wavpack;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-xm;application/x-flac;

gdk-pixbuf-thumbnailer.thumbnailer

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

Alternative: If you do not want to see thumbnails but only a quick preview you can easily use a small program present in the official ubuntu repo.

sudo apt install sushi

Once Sushi is installed on your computer perform these steps. Select any file and press the space bar. The file will open in a medium size preview window. Press the space bar again to dismiss the preview. The built-in preview supports most file formats for documents, images, video, and audio. In the preview, you can scroll through your documents or seek through your video and audio. To view a full-screen preview press F or F11. Press F or F11 again to leave full-screen, or press the space bar to exit the preview completely.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .