<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to get a Quick Look preview as an NSImage</title>
	<atom:link href="http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage/feed" rel="self" type="application/rss+xml" />
	<link>http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage</link>
	<description>Modesty is Lying</description>
	<lastBuildDate>Fri, 12 Mar 2010 00:19:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt Legend Gemmell</title>
		<link>http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage/comment-page-1#comment-39595</link>
		<dc:creator>Matt Legend Gemmell</dc:creator>
		<pubDate>Tue, 15 Apr 2008 20:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage#comment-39595</guid>
		<description>Hi Ken,

That&#039;s true - the current API is more intended for the icon preview rather than the Quick Look floating contents view, but it&#039;s possible to special-case certain file types and use an appropriate view to show the actual file (like a PDFView for PDFs). Not perfect, but offers a bit more than the icon.</description>
		<content:encoded><![CDATA[<p>Hi Ken,</p>
<p>That&#8217;s true &#8211; the current API is more intended for the icon preview rather than the Quick Look floating contents view, but it&#8217;s possible to special-case certain file types and use an appropriate view to show the actual file (like a PDFView for PDFs). Not perfect, but offers a bit more than the icon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage/comment-page-1#comment-39594</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Tue, 15 Apr 2008 19:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage#comment-39594</guid>
		<description>Hi. Thanks for the sample code!  I&#039;m a little bummed though.  It looks like this doesn&#039;t actually create the same image that the Finder uses to show the QuickLook panel.  

The &quot;thumbnail&quot; is never more than one page high.  If you use this with a 10 page Word doc, for example, you&#039;ll only get the first page, no matter what you specify for maximum height.

It seems that, internally, QL generators differentiate between thumbnails and previews, and we&#039;re not given a public API for accessing the latter.

-Ken</description>
		<content:encoded><![CDATA[<p>Hi. Thanks for the sample code!  I&#8217;m a little bummed though.  It looks like this doesn&#8217;t actually create the same image that the Finder uses to show the QuickLook panel.  </p>
<p>The &#8220;thumbnail&#8221; is never more than one page high.  If you use this with a 10 page Word doc, for example, you&#8217;ll only get the first page, no matter what you specify for maximum height.</p>
<p>It seems that, internally, QL generators differentiate between thumbnails and previews, and we&#8217;re not given a public API for accessing the latter.</p>
<p>-Ken</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dieter Komendera</title>
		<link>http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage/comment-page-1#comment-39363</link>
		<dc:creator>Dieter Komendera</dc:creator>
		<pubDate>Mon, 26 Nov 2007 10:29:44 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage#comment-39363</guid>
		<description>Hi Matt,

I&#039;ve written a little command line tool with the help of your NSImage category:
http://soakedandsoaped.com/articles/read/quickiee-create-preview-image-files-with-quicklook

Best
Dieter</description>
		<content:encoded><![CDATA[<p>Hi Matt,</p>
<p>I&#8217;ve written a little command line tool with the help of your NSImage category:<br />
<a href="http://soakedandsoaped.com/articles/read/quickiee-create-preview-image-files-with-quicklook" rel="nofollow">http://soakedandsoaped.com/articles/read/quickiee-create-preview-image-files-with-quicklook</a></p>
<p>Best<br />
Dieter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Legend Gemmell</title>
		<link>http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage/comment-page-1#comment-38967</link>
		<dc:creator>Matt Legend Gemmell</dc:creator>
		<pubDate>Thu, 01 Nov 2007 11:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage#comment-38967</guid>
		<description>Hi Troy,

Excellent, thanks for that. I&#039;ll update the code sample. :)</description>
		<content:encoded><![CDATA[<p>Hi Troy,</p>
<p>Excellent, thanks for that. I&#8217;ll update the code sample. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Troy</title>
		<link>http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage/comment-page-1#comment-38940</link>
		<dc:creator>Troy</dc:creator>
		<pubDate>Wed, 31 Oct 2007 17:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2007/10/29/how-to-get-a-quick-look-preview-as-an-nsimage#comment-38940</guid>
		<description>Hi Matt,

Nice idea for a handy wrapper!  I&#039;ve got a performance enhancement for this that I think you&#039;ll like: On Leopard, one can now initialize an NSBitmapImageRep to reference an existing CGImage.  This is much more lightweight, as it avoids the memory and CPU costs of copying the pixel data.  (The NSBitmapImageRep simply retains the CGImage, will only unpack a copy of the CGImage&#039;s content if you ask it for its -bitmapData or, equivalently, invoke -getBitmapDataPlanes:, which most casual BitmapImageRep usage doesn&#039;t do.)

&lt;code&gt;NSBitmapImageRep *bitmapImageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage]; // Take advantage of NSBitmapImageRep&#039;s -initWithCGImage: initializer, which is new in Leopard.
NSImage *newImage = nil;
if (bitmapImageRep) {
    newImage = [[NSImage alloc] initWithSize:[bitmapImageRep size]];
    [newImage addRepresentation:bitmapImageRep];
    [bitmapImageRep release];
}&lt;/code&gt;

Note also that one can now ask an NSBitmapImageRep to return a CGImage created from its pixel data.  (Be sure to keep the NSBitmapImageRep around for as long as the CGImage is in use, as the CGImage references the NSBitmapImageRep&#039;s data but doesn&#039;t retain the NSBitmapImageRep.)

This is mentioned in the Leopard Application Kit release notes.  Enjoy!
-Troy</description>
		<content:encoded><![CDATA[<p>Hi Matt,</p>
<p>Nice idea for a handy wrapper!  I&#8217;ve got a performance enhancement for this that I think you&#8217;ll like: On Leopard, one can now initialize an NSBitmapImageRep to reference an existing CGImage.  This is much more lightweight, as it avoids the memory and CPU costs of copying the pixel data.  (The NSBitmapImageRep simply retains the CGImage, will only unpack a copy of the CGImage&#8217;s content if you ask it for its -bitmapData or, equivalently, invoke -getBitmapDataPlanes:, which most casual BitmapImageRep usage doesn&#8217;t do.)</p>
<p><code>NSBitmapImageRep *bitmapImageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage]; // Take advantage of NSBitmapImageRep's -initWithCGImage: initializer, which is new in Leopard.<br />
NSImage *newImage = nil;<br />
if (bitmapImageRep) {<br />
    newImage = [[NSImage alloc] initWithSize:[bitmapImageRep size]];<br />
    [newImage addRepresentation:bitmapImageRep];<br />
    [bitmapImageRep release];<br />
}</code></p>
<p>Note also that one can now ask an NSBitmapImageRep to return a CGImage created from its pixel data.  (Be sure to keep the NSBitmapImageRep around for as long as the CGImage is in use, as the CGImage references the NSBitmapImageRep&#8217;s data but doesn&#8217;t retain the NSBitmapImageRep.)</p>
<p>This is mentioned in the Leopard Application Kit release notes.  Enjoy!<br />
-Troy</p>
]]></content:encoded>
	</item>
</channel>
</rss>
