Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thought I'd dig a little on this. I have not tried any of the following suggestions, so nobody get their hopes up. I'll assume you're using the generator callback:</p> <pre><code>OSStatus (*GeneratePreviewForURL)( void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options ); </code></pre> <p>Before anything else, you might manually check the <code>options</code> dictionary argument and verify that the <code>kQLPreviewPropertyWidthKey</code> and <code>kQLPreviewPropertyHeightKey</code> keys are indeed mapped to the desired <code>CFNumber</code> values.</p> <p>Referring to each of these properties, the Apple QuickLook programming guide says:</p> <blockquote> <p>Note that this property is a hint; Quick Look might set the width automatically for some types of previews. The value must be encapsulated in a CFNumber object.</p> </blockquote> <p>(<strong>Edit:</strong> If your preview representation is flexible, you might try finding a preview type for which QuickLook honors your size hints, as per the statement above. Just a thought.)</p> <p>Running <code>nm</code> on the QuickLook framework binary revealed some undocumented <code>kQLPreviewProperty--</code> constants as well as the aforementioned width and height keys. One that caught my attention was <code>kQLPreviewPropertyAutoSizeKey</code>. Recalling Apple's statement about ignoring the hints to set the size <em>automatically</em>, this might be significant? Following the convention in <code>QuickLook.framework/Headers/QLBase.h</code>, you might try declaring</p> <pre><code>extern const CFStringRef kQLPreviewPropertyAutoSizeKey; </code></pre> <p>Then you could try associating a CFNumber 0 with that property key in the <code>options</code> dictionary. There are other undocumented keys of note, such as <code>kQLPreviewPropertyAttributesKey</code>.</p> <p>Back to the Info.plist you mentioned, Apple <a href="https://developer.apple.com/library/mac/documentation/userexperience/conceptual/quicklook_programming_guide/Articles/QLProjectConfig.html" rel="nofollow noreferrer">says</a> about those keys <code>QLPreviewWidth</code> and <code>QLPreviewHeight</code>:</p> <blockquote> <p>This number gives Quick Look a hint for the width (in points) of previews. <strong>It uses these values if the generator takes too long to produce the preview.</strong> (emphasis added)</p> </blockquote> <p>This is where someone makes the terrible suggestion of calling sleep() in your generator. But I'm perplexed as to <em>why</em> Apple would make following the size hints dependent on the generator latency. (?)</p> <p><strong>Edit:</strong> Also note the above statement says the Info.plist hints must be expressed in points (not pixels), a <a href="https://graphicdesign.stackexchange.com/questions/199/point-vs-pixel-what-is-the-difference">unit</a> dependent on the user's screen resolution.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload