Nautilus不会为GIF图像生成缩略图


18

无论我尝试什么(更改预览选项,删除缩略图缓存等),Ubuntu 15.04中的Nautilus都不会为GIF图像文件生成缩略图。但是,它会为所有其他可预览文件类型生成一个缩略图。我能以某种方式解决这个问题吗?

Answers:


26

创建自己的缩略图:

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

添加以下内容:

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

安装imagemagick(以防默认情况下未安装):

sudo apt-get install imagemagick

清除缓存:

rm -r ~/.cache/thumbnails

资源


+1,但是在当前版本的Ubuntu中,还有另外两个问题。reddit.com/r/pop_os/comments/bcfh69/…提供了所有这三个问题的解决方法。
ruakh

2

请注意,每个缩略图占用可变数量的磁盘内存。当您第一次打开包含图像的文件夹时,系统将提供该图像以生成缩略图。如果文件夹中充满了文件,您将看到该过程一直运行到生成所有缩略图为止。一旦存储了这些缩略图,下一次您将打开该文件夹时,您将看不到任何生成过程。在Ubuntu中会生成缩略图,并因此将其存储在名为.cache的主文件夹之一中,而将设置存储在根文件夹中。您可以通过编辑dconf中的文件来检查nautilus是否能够显示预览(注意,如果使用不当,可能会损坏文件系统或使系统混乱)。

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

有关选项(也请参见dconf中的描述):

  • 始终->即使在远程服务器上也会显示thumbnaisl(对性能不利)
  • 仅本地->将在您的PC上本地显示缩略图(这是ubuntu 18.04中的默认设置)
  • 从不->仅显示默认图标

如果图像大于10 MB,将不显示预览,而仅显示默认图像图标。要解决此问题,您可以增加此限制(例如,增加一倍)。

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

一旦检查了nautilus是否能够执行其工作,就必须为缩略图设置创建文件夹(如果不存在):

sudo mkdir /usr/share/thumbnailers/

在此文件夹中,您必须为每个类型文件(或文件类别)创建一个名为typeoffile.thunbnailer的文件,但首先必须安装编辑和查看该类型文件所必需的程序。例如,如果您想查看pdf的缩略图,则应安装pdf查看器(例如evince,它是ubuntu 18.04中的默认设置),并进一步安装。对于原始映像,请安装以下两个软件包:

sudo apt install gnome-raw-thumbnailer ufraw-batch

对于视频预览:

sudo apt install ffmpegthumbnailer

正确安装程序后,重新启动nautilus

nautilus -q

但是,您必须清除存储在主目录中的缩略图缓存。如果浏览到该文件夹​​,将找到两个文件夹,一个用于普通缩略图,一个用于大型缩略图。

rm -r  ~/.cache/thumbnails/*

如果您认为缩略图生成的缓存太大,则甚至可以在cronjob中完成此工作。我张贴了设置文件夹中文件的文本。请注意,这在您的系统中可能有所不同。

gif。缩略图

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

原始缩略图

[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;

图腾缩略图

[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;

替代方法:如果您不希望看到缩略图,而只是快速预览,则​​可以轻松使用官方ubuntu存储库中的一个小程序。

sudo apt install sushi

在计算机上安装Sushi后,请执行以下步骤。选择任何文件,然后按空格键。该文件将在中等大小的预览窗口中打开。再次按空格键可关闭预览。内置预览支持文档,图像,视频和音频的大多数文件格式。在预览中,您可以滚动浏览文档或浏览视频和音频。要查看全屏预览,请按F或F11。再次按F或F11退出全屏显示,或按空格键完全退出预览。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.