API或其他用于访问Finder图标预览图像的方法 [英] API or other method for accessing Finder icon preview images

查看:52
本文介绍了API或其他用于访问Finder图标预览图像的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看来,macOS现在会为某些不是自定义图标而是其他东西的文件(尤其是RAW图像文件)生成预览图像.(您可以通过Finder窗口显示视图选项"中的显示图标预览"在不成熟的型号macOS中打开/​​关闭它们.)

It appears that macOS now generates preview images for certain files (notably RAW image files) that are not custom icons but something else. (You can toggle them on/off in latish model macOS via "show icon preview" in Finder window "Show View Options".)

我很希望能够获得这些图像或使用生成它们的API,但是显然我在搜索错误的术语.常用的API将为我提供文件图标(通常是通用文档图标),而不是预览.获取自定义图标(例如.DS_Store等)的技巧不适用.

I'd love to be able to either obtain these images or use the API that generates them but I'm obviously googling the wrong terms. The usual APIs will get me the file icon (which is usually a generic document icon) and not the preview. The tricks for getting custom icons (e.g. .DS_Store etc.) do not apply.

推荐答案

您想要的工具是 qlmanage .特别是,请查看 qlmanage -t (缩略图)和 qlmanage -p (预览).默认情况下,它将为您打开一个查看器.如果要生成要处理的文件,请参见 -o 选项.例如:

The tool you want is qlmanage. In particular, look at qlmanage -t (thumbnail) and qlmanage -p (preview). By default, it opens a viewer for you. If you want to generate files to process yourself, see the -o option. For example:

qlmanage -t image.png -o .

这将创建一个名为 ./image.png.png 的缩略图文件(它会将 .png 附加到任何文件名).

This will create a thumbnail file called ./image.png.png (it attaches .png to whatever the filename is).

如果您要围绕此构建自己的工具,请参见 QuickLook 框架.

If you want to build your own tools around this, see the QuickLook framework.

这篇关于API或其他用于访问Finder图标预览图像的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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