• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
QuickLook returning small image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: QuickLook returning small image
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: How to use inline functions
  • Next by Date: Re: data over USB to iPhone
  • Previous by thread: Re: data over USB to iPhone
  • Next by thread: Re: QuickLook returning small image
  • Index(es):
    • Date
    • Thread