Leopard: QuickLook Not For Our Applications

written October 28 2007 by
Kommen
tagged with
,
5 Comments so far. Go, post one!
Previous Check Rails Applicatio…
WebKit's CSS Animations Next
How to fix broken WebKit Framework after Safari 3.1 upgrade
Quickiee: Create Preview Image Files With QuickLook

With the release of Leopard, one of the features I really was looking forward to was QuickLook.

I was a bit disappointed, when I read in the documentation (login required), that Apple only provides an API to write generators, which produce previews and thumbnails for QuickLook, but they don’t provide an API to actually use QuickLook in 3rd party applications.

A note in the docs just says: “… private programmatic interfaces available to internal clients of Quick Look might one day be made available for third-party development (as API) in a future version of the Quick Looks framework.”

In particular, I was interested in getting plain images (PNG or JPEG) of QuickLook generated previews.
So if anybody knows a way to get those images, please let me know. :)

5 Comments

Make our day bright and participate!
Permalink to this comment { Samo Korosec }
on October 28 2007 (about 19:48 PM)

You could maybe use the internal APIs but with the drawback of having to reverse-engineer them. That approach works for some OS X apps (I think it was the approach for accessing the iSight when it first came out), with the drawback that your software can break if Apple changes something within the APIs.

Also, sooner or later people will document Quick Look and depending on how it works, one might be able to put a hook into it to intercept the generated images (it’s Bitmap Data after all) and redirect its output into a file.

But that’s all theory – the best thing would be if we install the 10.5 developer tools and see if we can hook ourselves into Quick Look and access it. If it’s Cocoa, it should be quite straight-forward.

Permalink to this comment { Samo Korosec }
on October 29 2007 (about 21:07 PM)

I found the following information on http://mattgemmell.com/2007/10/28/get-rid-of-your-code-with-leopard

“You can also request a Quick Look-generated preview of a document using QLThumbnailImageCreate() from the QuickLook framework (thanks to Mek for pointing that out). The preview can be of an arbitrary size you specify, of any document you like, and you can even tell the framework to draw it as an “icon” (i.e. with a drop-shadow, document page-curl and so on).”

Permalink to this comment { Tom Andersen }
on October 30 2007 (about 16:55 PM)

I think that they added QLThumbnailImageCreate in response to the WWDC 2007 – people complained.
Also as it says, be sure to call it in a thread. It seems to work well. You should keep the number of active requests limited to roughly the number of processors on the computer.

—Tom

Permalink to this comment { Matt Legend Gemmell }
on October 31 2007 (about 10:19 AM)

Hi there, I’m the author of the article linked in the previous comment. Just a note that I also created a category on NSImage to allow easily getting Quick Look previews of specified documents. Details here:
http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage

Permalink to this comment { kommen }
on October 31 2007 (about 14:34 PM)

@samo, matt: Thanks very much for the hints!

Do participate!

Textile (only links and basic formatting) is allowed.
These are not required