You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/06/27 19:50:34 UTC
git commit: ios: Delete postImage (dead code)
Repository: cordova-plugin-camera
Updated Branches:
refs/heads/master 5b8324e98 -> 1650dce69
ios: Delete postImage (dead code)
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/1650dce6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/1650dce6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/1650dce6
Branch: refs/heads/master
Commit: 1650dce693cccca785ecf03a6b5e4124ba4e8355
Parents: 5b8324e
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Jun 27 13:49:56 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Jun 27 13:49:56 2014 -0400
----------------------------------------------------------------------
src/ios/CDVCamera.h | 1 -
src/ios/CDVCamera.m | 42 ------------------------------------------
2 files changed, 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/1650dce6/src/ios/CDVCamera.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.h b/src/ios/CDVCamera.h
index 744ae7f..63deac9 100644
--- a/src/ios/CDVCamera.h
+++ b/src/ios/CDVCamera.h
@@ -84,7 +84,6 @@ typedef NSUInteger CDVMediaType;
* quality: integer between 1 and 100
*/
- (void)takePicture:(CDVInvokedUrlCommand*)command;
-- (void)postImage:(UIImage*)anImage withFilename:(NSString*)filename toUrl:(NSURL*)url;
- (void)cleanup:(CDVInvokedUrlCommand*)command;
- (void)repositionPopover:(CDVInvokedUrlCommand*)command;
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/1650dce6/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index ab99297..fc1afb4 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -533,48 +533,6 @@ static NSSet* org_apache_cordova_validArrowDirections;
return newImage;
}
-- (void)postImage:(UIImage*)anImage withFilename:(NSString*)filename toUrl:(NSURL*)url
-{
- self.hasPendingOperation = YES;
-
- NSString* boundary = @"----BOUNDARY_IS_I";
-
- NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:url];
- [req setHTTPMethod:@"POST"];
-
- NSString* contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
- [req setValue:contentType forHTTPHeaderField:@"Content-type"];
-
- NSData* imageData = UIImagePNGRepresentation(anImage);
-
- // adding the body
- NSMutableData* postBody = [NSMutableData data];
-
- // first parameter an image
- [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
- [postBody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"upload\"; filename=\"%@\"\r\n", filename] dataUsingEncoding:NSUTF8StringEncoding]];
- [postBody appendData:[@"Content-Type: image/png\r\n\r\n" dataUsingEncoding : NSUTF8StringEncoding]];
- [postBody appendData:imageData];
-
- // // second parameter information
- // [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
- // [postBody appendData:[@"Content-Disposition: form-data; name=\"some_other_name\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
- // [postBody appendData:[@"some_other_value" dataUsingEncoding:NSUTF8StringEncoding]];
- // [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@--\r \n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
-
- [req setHTTPBody:postBody];
-
- NSURLResponse* response;
- NSError* error;
- [NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&error];
-
- // NSData* result = [NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&error];
- // NSString * resultStr = [[[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding] autorelease];
-
- self.hasPendingOperation = NO;
-}
-
-
- (CLLocationManager *)locationManager {
if (locationManager != nil) {