macosquicklookutiosxfuse

Delegate QuickLook preview generation to other QLPlugin


I'm developing a QuickLook Preview Plugin for macOS.

I'm trying to generate a preview for remote files (osxfuse Virtual File System) and thus I have registered my QLPreview plugin as public.jpeg extension.

Now, macOS asks my QLPreview Plugin for EVERY image on file system and I just want for those inside my virtual file system folder. For regular jpeg files, system QuickLook plugin should be invoked.

Is it possible to delegate preview generation to other QuickLook plugin in case my QLPreview plugin is not able to generate a preview or somehow return OSStatus that macOS should try with other plugin registered with same UTI.

If that is not possible, is there a way to have a custom UTI for files that have .jpeg extension. Maybe like writing something to file extended attributes?

If none of aforementioned is possible, one option could be to have files in my VFS with extension .mycloud (ie some_image.jpeg.mycloud) and then register that extension as my custom UTI format and write QLPreview plugin for that UTI. And then later, when user downloads an image, mycloud extension would be removed and system would generate the preview which is now available anyways.


Solution

  • Your plugin should not overtake existing plugins for known extensions.

    Your best bet right now is that not-yet-downloaded files have your custom extension .mycloud for which you have your custom Preview/Thumbnail quicklook plugin.

    When you download the file, remove the .mycloud extension so that existing quicklook generator can take care of proper preview generation of existing file.