QLThumbnailProvider doesn't work

How do you get a macOS 10.15 QuickLook extension to work? I added the provider from the Xcode template. The .appex file is in the app bundle under Contents/Plugins/foo-thumb.appex

Can these Quicklook thumbnail providers override the system. So if macOS doesn't handle thumbnails for most types of ktx or any ktx2 files, can I override that with my own Quicklook plugin?

I tried using qlmanage with -m, and all I see are qlgenerators in there. I don't see any .appex files registered or listed. So when I try this on ktx (org.krhonos.ktx) and ktx2 files (public.ktx2) a thumbnail isn't generated.

qlmanager just seems to hang without the -x argument. And on the one file that worked, it pops up a thumbnail but I don't think it was generated by my appex.

sudo qlmanage -t /Users/Foo/tests/Toof-a.ktx -c org.khronos.ktx -x
Testing Quick Look thumbnails with files using server:
	/Users/Foo/tests/Toof-a.kt
	- force using content type UTI: org.khronos.ktx 

2021-05-28 10:04:52.471 qlmanage[23522:4229132] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x984b, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2021-05-28 10:04:52.477 qlmanage[23522:4229132] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x6607, name = 'com.apple.coredrag'
See /usr/include/servers/bootstrap_defs.h for the error codes.

* No thumbnail created for /Users/Foo/tests/Toof-a.ktx
Done producing thumbnails

I've set the UTI types in the Info.plist and followed all the instructions for setting up the template from the Apple documentation.

When it works, this is the output. But I don't think these was generated via my plugin, but via a system generator for .ktx.

/Users/Foo/tests/mac/Toof-a.ktx 2021-05-28 10:21:46.623 qlmanage[23586:4236472] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x634b, name = 'com.apple.tsm.portname' See /usr/include/servers/bootstrap_defs.h for the error codes. 2021-05-28 10:21:46.629 qlmanage[23586:4236472] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x650f, name = 'com.apple.coredrag' See /usr/include/servers/bootstrap_defs.h for the error codes. * /Users/Foo/tests/mac/Toof-a.ktx produced one thumbnail Done producing thumbnails 2021-05-28 10:21:46.996 qlmanage[23586:4236472] TISFileInterrogator updateSystemInputSources false but old data invalid: currentCacheHeaderPtr nonNULL? 0, ->cacheFormatVersion 0, ->magicCookie 00000000, inputSourceTableCountSys 0 Keyboard Layouts: duplicate keyboard layout identifier -17410. Keyboard Layouts: keyboard layout identifier -17410 has been replaced with -28673. Keyboard Layouts: duplicate keyboard layout identifier -30769. Keyboard Layouts: keyboard layout identifier -30769 has been replaced with -28674. Keyboard Layouts: duplicate keyboard layout identifier -14934. Keyboard Layouts: keyboard layout identifier -14934 has been replaced with -28675. 2021-05-28 10:21:48.296 qlmanage[23586:4236498] Persistent UI failed to open file file:///var/root/Library/Saved%20Application%20State/com.apple.quicklook.qlmanage.savedState/window_2.data: No such file or directory (2)

I see the following messages when I turn on the logging trying qlmanage on a .ktx2 file.

qlmanage -t /Users/Foo/tests/Toof-a.ktx2 -x


QuicklookSatellite extractOptions:142: *** unknown hint identifier 'kCGImageSourceTypeIdentifierHint:public.ktx2' -- ignoring...

Will not generate thumbnail from image because it has an incorrect size: (0.000000, 0.000000)

com.apple.quicklook.ThumbnailsAgent CGBitmapContextCreateImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

distnoted register name: com.apple.nsquiet_safe_quit_give_reason object: com.apple.quicklook.qlmanage token: 380000003e pid: 31960

I can see the appex listed in the "Extensions" and it's enabled. And it's sandboxes=d, and the app the appex is inside is sandboxed.

I have built versions of the app and plugin in various parts of my drive, but can't QL handle that? Why is it getting confused as to which one to run. I have the one I want QL (and qlmanage) to run in the Applications folder.

Then qlmanage just sits there running, and doesn't ever finish. I can quit or kill the app. Sometimes when it does finish, it just says "no thumbnail created".

[d ] [u com.foo.app.thumbnailer] [()] detected another plugin with a newer modification date: [u 22C44ECE-8E9A-4D9D-A303-XXXXXXX] [()]

[d ] [u com.foo.app.thumbnailer] [()] rejecting; another plugin has precedent: [u 22C44ECE-8E9A-4D9D-A303-XXXXXXXX] [()]

Ultimately qlmanage is just sitting there, with the only relevant last message being this timeout.

qlmanage: LSExceptions shared instance invalidated for timeout.

QLThumbnailProvider doesn't work
 
 
Q