summaryrefslogtreecommitdiffstats
path: root/Classes/HJMOHandler.m
diff options
context:
space:
mode:
Diffstat (limited to 'Classes/HJMOHandler.m')
-rwxr-xr-xClasses/HJMOHandler.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/Classes/HJMOHandler.m b/Classes/HJMOHandler.m
index fb8643e..ab95766 100755
--- a/Classes/HJMOHandler.m
+++ b/Classes/HJMOHandler.m
@@ -11,11 +11,13 @@
#import "HJMOUser.h"
#import "HJObjManager.h"
#import "HJMOFileCache.h"
+#import "HJManagedImageV.h"
@implementation HJMOHandler
@synthesize state;
+@synthesize squareCropped;
@synthesize oid;
@synthesize url;
@synthesize urlConn;
@@ -341,6 +343,21 @@
[moLoadingDataFile closeFile];
self.moLoadingDataFile = nil;
self.urlConn = nil;
+
+ // manipulate file here
+ if ([users count] > 0) {
+ HJManagedImageV *user = [users objectAtIndex:0];
+ if (self.squareCropped) {
+ NSLog(@"here");
+ HJMOFileCache* fileCache = objManager.fileCache;
+ NSString* loadingFile = [[fileCache loadingFilePathForOid:oid] retain];
+ UIImage *cropped = [[[UIImage imageWithContentsOfFile:loadingFile] imageByScalingAndCroppingForSize:CGSizeMake(100,100)] retain];
+ //[[[UIImageView alloc] initWithImage:[moHandler.moData imageByScalingAndCroppingForSize:CGSizeMake(100,100)]] autorelease];
+ [UIImagePNGRepresentation(cropped) writeToFile:loadingFile atomically:YES];
+ NSLog(@"after");
+ }
+ }
+
NSString* readyFilename = [self.objManager.fileCache loadingFinishedForOid:oid];
if (readyFilename==nil) {
state = stateFailed;