From bd46402a18f50a5f6b13d6e36a685f8342b59419 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 6 Aug 2009 10:12:54 -0400 Subject: [PATCH] Properly ask NSImage for an NSImageRef that is appropriately sized for a screen resolution and let the NSImageView object worry about scaling it. Fixes the annoying problem of the gallery key images being really really tiny. --- iPhoto2Ansel/AnselExportController.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iPhoto2Ansel/AnselExportController.m b/iPhoto2Ansel/AnselExportController.m index 591a819d7..cc9db658f 100644 --- a/iPhoto2Ansel/AnselExportController.m +++ b/iPhoto2Ansel/AnselExportController.m @@ -713,9 +713,17 @@ NSString * const TURAnselServerPasswordKey = @"password"; currentGallery = [[anselController getGalleryByIndex:row] retain]; [currentGallery setDelegate: self]; - // TODO: Figure out why these don't always properly size. + // Obtain and properly size the image for screen NSImage *theImage = [[NSImage alloc] initWithContentsOfURL: [currentGallery galleryDefaultImageURL]]; + NSSize imageSize; + imageSize.width = [[theImage bestRepresentationForDevice:nil] pixelsWide]; + imageSize.height = [[theImage bestRepresentationForDevice:nil] pixelsHigh]; + [theImage setScalesWhenResized:YES]; + [theImage setSize:imageSize]; + + // Show it [defaultImageView setImage: theImage]; + [theImage release]; [self canExport]; [viewGallery setEnabled: YES]; -- 2.11.0