Unhide the size popup
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 5 Dec 2008 23:22:01 +0000 (18:22 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 5 Dec 2008 23:23:49 +0000 (18:23 -0500)
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 :)

iPhoto2Ansel/AnselExportController.m
iPhoto2Ansel/English.lproj/Panel.nib/info.nib
iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib

index 17b8ceb..96dcfec 100644 (file)
@@ -5,8 +5,6 @@
 //  Created by Michael Rubinsky on 10/23/08.
 //  Copyright 2008 __MyCompanyName__. All rights reserved.
 //
-#import <QuickTime/QuickTime.h>
-#import <QuickTime/ImageCompression.h>
 #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];
 -(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];
         // 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  
index 64a4a91..fb256c0 100644 (file)
@@ -10,7 +10,7 @@
        <integer>5</integer>
        <key>IBOpenObjects</key>
        <array>
-               <integer>136</integer>
+               <integer>7</integer>
        </array>
        <key>IBSystem Version</key>
        <string>9F33</string>
index d5e224c..33b9caf 100644 (file)
Binary files a/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib and b/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib differ