Nautilus 没有加载任何图像和视频的预览。在安装了一些缩略图程序(如ffmpegthumbnailer
和)后evince-thumbnailer
,我确实可以预览视频和 PDF 文件,但仍然无法预览任何图像。
我尝试了各种 stackexchange 帖子中关于此主题的许多建议,例如删除整个~/.cache/thumbnails
文件夹、使用 检查 nautilus 的缩略图设置dconf-editor
、检查 中的全局缩略图设置dconf-editor
。所有设置均正确,但仍然没有图像缩略图。
[编辑] 我去年换用了 Ubuntu,所以当时安装的版本是 23.04。现在我使用的是 23.10。自从我使用 Ubuntu 以来,这个问题一直存在。
答案1
就我而言,我可以通过在调试模式下重新启动 nautilus 来找出问题:将其粘贴到终端中。
nautilus -q
G_MESSAGES_DEBUG=all NAUTILUS_DEBUG=Window nautilus
消息中的某处有一个警告:
(org.gnome.Nautilus:34905): GnomeDesktop-WARNING **: 14:06:33.878: Failed to load thumbnailer from "/usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer": Die Schlüsselwertedatei enthält die Zeile »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;«, welche kein zulässiges Schlüssel-Wert-Paar, keine Gruppe und kein Kommentar ist
这句话的意思是:所有缩略图程序都需要有一个.thumbnail
文件/usr/share/thumbnailers
,以注册它们将处理的图像类型以及说明程序所在的位置。
GNOME 桌面环境中负责生成图像预览的程序是gdk-pixbuf-thumbnailer
。在其各自的 .thumbnail 文件中,指定了此缩略图程序应处理的 MIME 类型(图像格式)。
cat /usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer
返回:
[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/png;image/jpeg;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/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;
正如上面的德文警告所示:最后一行无效,因为它不是键值对,而只是上MimeType
面值的延续。因此,整个缩略图程序停止工作。通过使用您最喜欢的文本编辑器将最后一行附加到 -value 来解决这个问题MimeType=
(您需要 root 权限):
sudo nano /usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer
之后,该文件对我来说看起来像这样:
[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/png;image/jpeg;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/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;
这是我的个人解决办法,我希望它能够帮助那些遇到同样问题的人。