如何获取Nautilus用于给定文件的缩略图? [英] How can I get the thumbnail that nautilus uses for a given file?

查看:153
本文介绍了如何获取Nautilus用于给定文件的缩略图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Nautilus向我显示文件的缩略图,如果是图像,则将显示预览,如果是视频,则将显示视频的帧,如果是文档,则将显示应用程序图标.

Nautilus shows me a thumbnail of a file, if its an image it will show me a preview, if its a video it will show a frame from the video, if its a document it will show me the application icon.

如何访问图像?

我看到它们被缓存在~/.thumbnail/中,但是它们都被赋予了唯一的名称.

I see they are cached in ~/.thumbnail/ however they are all given unique names.

推荐答案

缩略图文件名是文件名的md5.但是文件名 是图片的绝对URI(没有换行符).

the thumbnail filename is an md5 of the filename. However the filename is the absolute URI to the image (without a newline).

所以您需要这样做:

echo -n 'file:///home/yuzem/pics/foo.jpg' | md5sum

如果有空格,则需要将其转换为'%20',例如"foo bar.jpg"

And if it has spaces, you need to convert them to '%20', ex for "foo bar.jpg"

echo -n 'file:///home/yuzem/pics/foo%20bar.jpg' | md5sum

Ubuntu论坛中找到.另请参见缩略图管理标准文档,该文档与 freedesktop.org Wiki .

Found at Ubuntu forums. See also the Thumbnail Managing Standard document, linked from the freedesktop.org wiki.

这篇关于如何获取Nautilus用于给定文件的缩略图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆