From da0bd5088116f8c984880cc6a15c83532f558753 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Wed, 6 Aug 2014 19:42:16 +0000 Subject: OS X: QuickLook: some minor tweaking. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@91193 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/Pcsxr-QL/GeneratePreviewForURL.m | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'macosx/Pcsxr-QL/GeneratePreviewForURL.m') diff --git a/macosx/Pcsxr-QL/GeneratePreviewForURL.m b/macosx/Pcsxr-QL/GeneratePreviewForURL.m index ae58b002..e81492f0 100644 --- a/macosx/Pcsxr-QL/GeneratePreviewForURL.m +++ b/macosx/Pcsxr-QL/GeneratePreviewForURL.m @@ -104,15 +104,16 @@ static OSStatus GeneratePreviewForMemCard(void *thisInterface, QLPreviewRequestR for (PcsxrMemoryObject *obj in memCards) { if (obj.memImageIndex == -1 || obj.memIconCount == 1) { NSMutableData *pngData = [NSMutableData new]; - CGImageDestinationRef dst = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)pngData, kUTTypePNG, 1, NULL); - NSImage *theImage = [obj firstMemImage]; - NSRect smallRect = NSMakeRect(0, 0, 16, 16); - - CGImageRef imageRef = [theImage CGImageForProposedRect:&smallRect context:nil hints:nil]; - CGImageDestinationAddImage(dst, imageRef, NULL); - - CGImageDestinationFinalize(dst); - CFRelease(dst); + { + CGImageDestinationRef dst = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)pngData, kUTTypePNG, 1, NULL); + NSImage *theImage = [obj firstMemImage]; + + CGImageRef imageRef = [theImage CGImageForProposedRect:NULL context:nil hints:nil]; + CGImageDestinationAddImage(dst, imageRef, NULL); + + CGImageDestinationFinalize(dst); + CFRelease(dst); + } NSDictionary *imgProps = @{(NSString *)kQLPreviewPropertyAttachmentDataKey: pngData, (NSString *)kQLPreviewPropertyMIMETypeKey: @"image/png"}; -- cgit v1.2.3