From: Michael J. Rubinsky Date: Fri, 5 Dec 2008 23:22:01 +0000 (-0500) Subject: Unhide the size popup X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=59abc6011b451ba235e5d6188dfcb56c74cebeb6;p=horde.git Unhide the size popup Implement image on the fly image scaling during upload. This is MUCH better then using the full size images. Yes, the interface needs much TLC, but one thing at a time :) --- diff --git a/iPhoto2Ansel/AnselExportController.m b/iPhoto2Ansel/AnselExportController.m index 17b8ceb38..96dcfec46 100644 --- a/iPhoto2Ansel/AnselExportController.m +++ b/iPhoto2Ansel/AnselExportController.m @@ -5,8 +5,6 @@ // Created by Michael Rubinsky on 10/23/08. // Copyright 2008 __MyCompanyName__. All rights reserved. // -#import -#import #import "TURAnsel.h" #import "TURAnselGallery.h" #import "AnselExportController.h" @@ -36,7 +34,6 @@ { // UI Defaults [mSizePopUp selectItemWithTag:2]; - [mQualityPopUp selectItemWithTag:2]; [connectedLabel setStringValue:@"Not Connected"]; [connectedLabel setTextColor: [NSColor redColor]]; [spinner stopAnimation:self]; @@ -58,10 +55,10 @@ -(void)doConnect: (id)sender { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSDictionary *p = [[NSDictionary alloc] initWithObjects:[NSArray arrayWithObjects:[anselHostURL stringValue], + NSDictionary *p = [[NSDictionary alloc] initWithObjects: [NSArray arrayWithObjects:[anselHostURL stringValue], [username stringValue], [password stringValue], nil] - forKeys:[NSArray arrayWithObjects:@"endpoint", @"username", @"password", nil]]; + forKeys: [NSArray arrayWithObjects:@"endpoint", @"username", @"password", nil]]; // Create our controller anselController = [[TURAnsel alloc] initWithConnectionParameters:p]; [anselController setDelegate:self]; @@ -297,8 +294,28 @@ // Prepare the image data NSData *theImage = [[NSData alloc] initWithContentsOfFile: [mExportMgr imagePathAtIndex:i]]; + CGFloat imageSize; + switch([mSizePopUp selectedTag]) + { + case 0: + imageSize = 320; + break; + case 1: + imageSize = 640; + break; + case 2: + imageSize = 1280; + break; + case 3: + imageSize = 99999; + break; + default: + imageSize = 1280; + break; + } + NSData *scaledData = [ImageResizer getScaledImageFromData: theImage - toSize: NSMakeSize(400, 400)]; + toSize: NSMakeSize(imageSize, imageSize)]; NSString *base64ImageData = [NSString base64StringFromData: scaledData diff --git a/iPhoto2Ansel/English.lproj/Panel.nib/info.nib b/iPhoto2Ansel/English.lproj/Panel.nib/info.nib index 64a4a91f8..fb256c095 100644 --- a/iPhoto2Ansel/English.lproj/Panel.nib/info.nib +++ b/iPhoto2Ansel/English.lproj/Panel.nib/info.nib @@ -10,7 +10,7 @@ 5 IBOpenObjects - 136 + 7 IBSystem Version 9F33 diff --git a/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib b/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib index d5e224c8d..33b9caf10 100644 Binary files a/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib and b/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib differ