QuickLook returning small image
QuickLook returning small image
- Subject: QuickLook returning small image
- From: aglee <email@hidden>
- Date: Thu, 13 Jan 2011 17:43:32 +0000 (GMT)
I'm requesting a QuickLook preview for an OmniGraffle file. The size I'm asking for is 500x300. The image I get back is much smaller, at 122x77, which looks terrible when I display it in my application. When I use QuickLook to preview the same file in the Finder, it looks great.
Why would I get such a small image back?
Here's the code I'm using (courtesy of Matt Gemmell's handy extension on NSImage):
NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSNumbernumberWithBool:icon]
forKey:(NSString*)kQLThumbnailOptionIconModeKey];
CGImageRef ref = QLThumbnailImageCreate(kCFAllocatorDefault,
(CFURLRef)fileURL,
CGSizeMake(size.width, size.height),
(CFDictionaryRef)dict);
NSLog(@"ref [%d, %d]", CGImageGetWidth(ref), CGImageGetHeight(ref));
The size passed to QLThumbnailImageCreate is documented as an upper bound. I assume that means there's no promise the returned image will actually be that size. But again, the Finder is able to get previews at any size I want.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden