我的设置是macOs上的电子应用程序。我正在使用exec-sh来运行$ qlmanage
...来生成缩略图。一切正常,除非我签署应用程序并将沙盒权利设置为true。我尝试了一切,但没有任何作用:
如果我将com.apple.security.app-sandbox
设置为false
就行了。错误日志对我来说没用:
Error: Shell command exit with non zero code: 255
我很不确定是否有可能在沙盒应用程序中运行$ qlmanage
...
要从文件中获取Quicklook图像,您宁愿使用
CGImageRef QLThumbnailImageCreate(CFAllocatorRef allocator, CFURLRef url, CGSize maxThumbnailSize, CFDictionaryRef options);
这将返回一个CGImage,您可以将其用作缩略图。请参阅此处的文档:https://developer.apple.com/documentation/quicklook/1402623-qlthumbnailimagecreate