<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,6 +10,7 @@
 
 @implementation NSImage (QuickLook)
 
+
 + (NSImage *)imageWithPreviewOfFileAtPath:(NSString *)path ofSize:(NSSize)size asIcon:(BOOL)icon
 {
     NSURL *fileURL = [NSURL fileURLWithPath:path];
@@ -25,6 +26,9 @@
                                             (CFDictionaryRef)dict);
     
     if (ref != NULL) {
+        // Take advantage of NSBitmapImageRep's -initWithCGImage: initializer, new in Leopard,
+        // which is a lot more efficient than copying pixel data into a brand new NSImage.
+        // Thanks to Troy Stephens @ Apple for pointing this new method out to me.
         NSBitmapImageRep *bitmapImageRep = [[NSBitmapImageRep alloc] initWithCGImage:ref];
         NSImage *newImage = nil;
         if (bitmapImageRep) {
@@ -49,4 +53,5 @@
     return nil;
 }
 
+
 @end</diff>
      <filename>NSImage+QuickLook.m</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,9 @@
 //  main.m
 //  quickiee
 //
-//  Created by Dieter Komendera on 11/14/07.
-//
+//  Created by Dieter Komendera on 11/14/07. http://komendera.com
+//  Licence: DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+//  http://sam.zoy.org/wtfpl/COPYING
 
 #import &lt;Cocoa/Cocoa.h&gt;
 #import &lt;QuickLook/QuickLook.h&gt;
@@ -32,7 +33,7 @@
     if(argc &gt;= 5) {
         format = [NSString stringWithUTF8String:argv[4]];
     } else {
-        format = @&quot;jpg&quot;;
+        format = @&quot;png&quot;;
     }
     
 	NSImage *image = [NSImage imageWithPreviewOfFileAtPath:srcfile
@@ -42,7 +43,7 @@
     NSBitmapImageRep *rep = [[image representations] objectAtIndex: 0];
     
     NSData *data;
-    if([format caseInsensitiveCompare:@&quot;jpg&quot;] == 0) {
+    if([format caseInsensitiveCompare:@&quot;png&quot;] == 0) {
         data =  [rep representationUsingType: NSJPEGFileType properties: nil];
     } else if([format caseInsensitiveCompare:@&quot;tiff&quot;] == 0) {
         data = [rep representationUsingType: NSTIFFFileType properties: nil];
@@ -50,8 +51,13 @@
         data = [rep representationUsingType: NSBMPFileType properties: nil];
     } else if([format caseInsensitiveCompare:@&quot;gif&quot;] == 0) {
         data = [rep representationUsingType: NSGIFFileType properties: nil];
-    } else {
+    } else if([format caseInsensitiveCompare:@&quot;jpg&quot;] == 0){
         data = [rep representationUsingType: NSPNGFileType properties: nil];
+    } else {
+        printf(&quot;unknown format: &quot;);
+        printf([format UTF8String]);
+        printf(&quot;\n&quot;);
+        return -1;
     }
     [data writeToFile: dstfile atomically: NO];
 </diff>
      <filename>main.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7e79724fc88fccb42bb1d2ed385bf346e76503b8</id>
    </parent>
  </parents>
  <author>
    <name>Dieter Komendera</name>
    <email>dieter@komendera.com</email>
  </author>
  <url>http://github.com/kommen/quikiee/commit/09e745ebe18be855fad0eeb2900f6d434882aa01</url>
  <id>09e745ebe18be855fad0eeb2900f6d434882aa01</id>
  <committed-date>2008-06-03T00:19:51-07:00</committed-date>
  <authored-date>2008-06-03T00:19:51-07:00</authored-date>
  <message>Clean up, add code comments.</message>
  <tree>11f4163d73e0a8711aa88d784a84075ad28fc6d6</tree>
  <committer>
    <name>Dieter Komendera</name>
    <email>dieter@komendera.com</email>
  </committer>
</commit>
