Changeset 2959
- Timestamp:
- 06/17/05 22:27:46 (3 years ago)
- Files:
-
- Footagehead/trunk/FHImage.m (modified) (8 diffs)
- Footagehead/trunk/FHURLHandler.m (modified) (3 diffs)
- Footagehead/trunk/Footagehead.xcodeproj/project.pbxproj (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/FHImage.m
r2948 r2959 27 27 */ 28 28 29 #import "NSData-FHAdditions.h" 29 30 #import "NSImage-FHAdditions.h" 30 31 #import "FHImage.h" … … 32 33 @interface FHImage(Private) 33 34 35 - (BOOL)_initImageWithData:(NSData *)data; 36 37 34 38 static BOOL FHImageUseCGImage = YES; 35 39 … … 55 59 56 60 - (id)initImageWithURL:(ZAURL *)url { 61 NSData *data; 62 63 self = [super init]; 64 65 data = [NSData dataWithContentsOfURL:url returningResponse:NULL]; 66 67 if(!data) { 68 [self release]; 69 70 return NULL; 71 } 72 73 if(![self _initImageWithData:data]) { 74 [self release]; 75 76 return NULL; 77 } 78 79 return self; 80 } 81 82 83 84 - (id)initImageWithURL:(ZAURL *)url preferredSize:(NSSize)size { 57 85 self = [super init]; 58 86 … … 68 96 } 69 97 70 _CGImage = FHImageLoadCGImage FromSource(imageSource);98 _CGImage = FHImageLoadCGImageThumbnailFromSource(imageSource, size.width); 71 99 72 100 if(!_CGImage) { … … 81 109 CFRelease(imageSource); 82 110 } else { 83 _NSImage = [[NSImage alloc] initWith ContentsOfURL:[url URL]];111 _NSImage = [[NSImage alloc] initWithJPEGFile:[url path] preferredSize:size]; 84 112 85 113 if(!_NSImage) { … … 97 125 98 126 99 - (id)initImageWithURL:(ZAURL *)url preferredSize:(NSSize)size {100 self = [super init];101 102 if(FHImageUseCGImage && CGImageSourceCreateWithURL != NULL) {103 CGImageSourceRef imageSource;104 105 imageSource = CGImageSourceCreateWithURL((CFURLRef) [url URL], NULL);106 107 if(!imageSource) {108 [self release];109 110 return NULL;111 }112 113 _CGImage = FHImageLoadCGImageThumbnailFromSource(imageSource, size.width);114 115 if(!_CGImage) {116 [self release];117 CFRelease(imageSource);118 119 return NULL;120 }121 122 _size = NSMakeSize(CGImageGetWidth(_CGImage), CGImageGetHeight(_CGImage));123 124 CFRelease(imageSource);125 } else {126 _NSImage = [[NSImage alloc] initWithJPEGFile:[url path] preferredSize:size];127 128 if(!_NSImage) {129 [self release];130 131 return NULL;132 }133 134 _size = [_NSImage size];135 }136 137 return self;138 }139 140 141 142 127 - (id)initImageWithData:(NSData *)data { 143 128 self = [super init]; 144 129 130 if(![self _initImageWithData:data]) { 131 [self release]; 132 133 return NULL; 134 } 135 136 return self; 137 } 138 139 140 141 - (BOOL)_initImageWithData:(NSData *)data { 145 142 if(FHImageUseCGImage && CGImageSourceCreateWithData != NULL) { 146 143 CGImageSourceRef imageSource; … … 148 145 imageSource = CGImageSourceCreateWithData((CFDataRef) data, NULL); 149 146 150 if(!imageSource) { 151 [self release]; 152 153 return NULL; 154 } 155 147 if(!imageSource) 148 return NO; 149 156 150 _CGImage = FHImageLoadCGImageFromSource(imageSource); 157 151 158 152 if(!_CGImage) { 159 [self release];160 153 CFRelease(imageSource); 161 154 162 return N ULL;155 return NO; 163 156 } 164 157 … … 169 162 _NSImage = [[NSImage alloc] initWithData:data]; 170 163 171 if(!_NSImage) { 172 [self release]; 173 174 return NULL; 175 } 164 if(!_NSImage) 165 return NO; 176 166 177 167 _size = [_NSImage size]; 178 168 } 179 169 180 return self;170 return YES; 181 171 } 182 172 Footagehead/trunk/FHURLHandler.m
r2948 r2959 27 27 */ 28 28 29 #import "NSData-FHAdditions.h" 29 30 #import "FHURLHandler.h" 30 31 #import "FHFeedHandler.h" … … 66 67 67 68 - (id)initHandlerWithURL:(ZAURL *)url { 68 NSURLRequest *request;69 69 NSURLResponse *response; 70 70 NSData *data; … … 80 80 } 81 81 82 request = [NSURLRequest requestWithURL:[url URL]]; 83 data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:NULL]; 82 data = [NSData dataWithContentsOfURL:url returningResponse:&response]; 83 84 if(!data) 85 return NULL; 86 84 87 mime = [response MIMEType]; 85 88 Footagehead/trunk/Footagehead.xcodeproj/project.pbxproj
r2955 r2959 134 134 A53901F40596A3E7000FBFD6 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A53901F30596A3E7000FBFD6 /* Carbon.framework */; }; 135 135 A54BD5420566834700E3ACBC /* FHFullscreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A54BD5400566834700E3ACBC /* FHFullscreenWindow.m */; }; 136 A570FD9F0863661300317D0F /* NSData-FHAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A570FD9D0863661300317D0F /* NSData-FHAdditions.m */; }; 136 137 A583338E069E30D100D6A96D /* Reload.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A583338D069E30D100D6A96D /* Reload.tiff */; }; 137 138 A587DF71055AA3C4005D2097 /* Delete.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A587DF6E055AA3C4005D2097 /* Delete.tiff */; }; … … 204 205 containerPortal = 77396B390857A18300058AF5 /* ZankaAdditions.xcodeproj */; 205 206 proxyType = 2; 206 remoteGlobalIDString = 8DC2EF5B0486A6940098B216 /* ZankaAdditions.framework */;207 remoteGlobalIDString = 8DC2EF5B0486A6940098B216; 207 208 remoteInfo = "Zanka Additions"; 208 209 }; … … 211 212 containerPortal = 77396B390857A18300058AF5 /* ZankaAdditions.xcodeproj */; 212 213 proxyType = 2; 213 remoteGlobalIDString = A5E4B39E07A9797200BD6812 /* ZAAutoreleasePool Test.app */;214 remoteGlobalIDString = A5E4B39E07A9797200BD6812; 214 215 remoteInfo = "ZAAutoreleasePool Test"; 215 216 }; … … 218 219 containerPortal = 77396B390857A18300058AF5 /* ZankaAdditions.xcodeproj */; 219 220 proxyType = 2; 220 remoteGlobalIDString = A553B5E007AAF56E005EE3E5 /* ZANotificationCenter Test.app */;221 remoteGlobalIDString = A553B5E007AAF56E005EE3E5; 221 222 remoteInfo = "ZANotificationCenter Test"; 222 223 }; … … 225 226 containerPortal = 77396B390857A18300058AF5 /* ZankaAdditions.xcodeproj */; 226 227 proxyType = 2; 227 remoteGlobalIDString = A5E4B55207A98AEE00BD6812 /* ZAObject Test.app */;228 remoteGlobalIDString = A5E4B55207A98AEE00BD6812; 228 229 remoteInfo = "ZAObject Test"; 229 230 }; … … 232 233 containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; 233 234 proxyType = 1; 234 remoteGlobalIDString = 77512CE50862CF78002757A8 /* Zanka Additions */;235 remoteGlobalIDString = 77512CE50862CF78002757A8; 235 236 remoteInfo = "Zanka Additions"; 236 237 }; … … 239 240 containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; 240 241 proxyType = 1; 241 remoteGlobalIDString = 77512F3C0862D69D002757A8 /* libjpeg */;242 remoteGlobalIDString = 77512F3C0862D69D002757A8; 242 243 remoteInfo = libjpeg; 243 244 }; … … 358 359 A54BD5410566834700E3ACBC /* FHFullscreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = FHFullscreenWindow.h; sourceTree = "<group>"; }; 359 360 A54D2E8D076214FC00227EBE /* ZankaAdditions.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ZankaAdditions.framework; path = ../ZankaAdditions/build/ZankaAdditions.framework; sourceTree = SOURCE_ROOT; }; 361 A570FD9C0863661300317D0F /* NSData-FHAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData-FHAdditions.h"; sourceTree = "<group>"; }; 362 A570FD9D0863661300317D0F /* NSData-FHAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData-FHAdditions.m"; sourceTree = "<group>"; }; 360 363 A583338D069E30D100D6A96D /* Reload.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Reload.tiff; sourceTree = "<group>"; }; 361 364 A587DF6E055AA3C4005D2097 /* Delete.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Delete.tiff; sourceTree = "<group>"; }; … … 661 664 770EBFC3083C94CE0094BD6C /* NSBitmapImageRep-FHAdditions.m */, 662 665 770EBFC2083C94CE0094BD6C /* NSBitmapImageRep-FHAdditions.h */, 666 A570FD9D0863661300317D0F /* NSData-FHAdditions.m */, 667 A570FD9C0863661300317D0F /* NSData-FHAdditions.h */, 663 668 775BA4F0075F70ED00F0941E /* NSImage-FHAdditions.m */, 664 669 775BA4EF075F70ED00F0941E /* NSImage-FHAdditions.h */, … … 974 979 77EAC0D5084C6D1F006C9F69 /* FHFlickrHandler.m in Sources */, 975 980 77494704085A57F600BA0915 /* FHImage.m in Sources */, 981 A570FD9F0863661300317D0F /* NSData-FHAdditions.m in Sources */, 976 982 ); 977 983 runOnlyForDeploymentPostprocessing = 0; … … 1050 1056 COPY_PHASE_STRIP = NO; 1051 1057 GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 1052 OPTIMIZATION_CFLAGS = " ";1058 OPTIMIZATION_CFLAGS = "-O0"; 1053 1059 OTHER_CFLAGS = ""; 1054 1060 OTHER_LDFLAGS = ""; … … 1067 1073 isa = XCBuildConfiguration; 1068 1074 buildSettings = { 1069 OPTIMIZATION_CFLAGS = " ";1075 OPTIMIZATION_CFLAGS = "-O0"; 1070 1076 OTHER_CFLAGS = ""; 1071 1077 OTHER_LDFLAGS = ""; … … 1086 1092 COPY_PHASE_STRIP = YES; 1087 1093 GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 1088 OPTIMIZATION_CFLAGS = " ";1094 OPTIMIZATION_CFLAGS = "-O0"; 1089 1095 OTHER_CFLAGS = ""; 1090 1096 OTHER_LDFLAGS = "";
