diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-31 08:21:38 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-31 08:21:38 -0400 |
| commit | 02811010cf62f1b21a06780d1e470d04bb24c50f (patch) | |
| tree | 0d933789068aac11c810ed4bb169d14ab16c43c6 /plugins/org.devgeeks.Canvas2ImagePlugin/src/ios/Canvas2ImagePlugin.m | |
| parent | bca561c1b3989d62a1fba829e0380c6fbf36caf5 (diff) | |
removed unecessary files from git
Diffstat (limited to 'plugins/org.devgeeks.Canvas2ImagePlugin/src/ios/Canvas2ImagePlugin.m')
| -rw-r--r-- | plugins/org.devgeeks.Canvas2ImagePlugin/src/ios/Canvas2ImagePlugin.m | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/plugins/org.devgeeks.Canvas2ImagePlugin/src/ios/Canvas2ImagePlugin.m b/plugins/org.devgeeks.Canvas2ImagePlugin/src/ios/Canvas2ImagePlugin.m deleted file mode 100644 index 734ee006..00000000 --- a/plugins/org.devgeeks.Canvas2ImagePlugin/src/ios/Canvas2ImagePlugin.m +++ /dev/null @@ -1,58 +0,0 @@ -// -// Canvas2ImagePlugin.m -// Canvas2ImagePlugin PhoneGap/Cordova plugin -// -// Created by Tommy-Carlos Williams on 29/03/12. -// Copyright (c) 2012 Tommy-Carlos Williams. All rights reserved. -// MIT Licensed -// - -#import "Canvas2ImagePlugin.h" -#import <Cordova/CDV.h> - -@implementation Canvas2ImagePlugin -@synthesize callbackId; - -//-(CDVPlugin*) initWithWebView:(UIWebView*)theWebView -//{ -// self = (Canvas2ImagePlugin*)[super initWithWebView:theWebView]; -// return self; -//} - -- (void)saveImageDataToLibrary:(CDVInvokedUrlCommand*)command -{ - self.callbackId = command.callbackId; - NSData* imageData = [NSData dataFromBase64String:[command.arguments objectAtIndex:0]]; - - UIImage* image = [[[UIImage alloc] initWithData:imageData] autorelease]; - UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); - -} - -- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo -{ - // Was there an error? - if (error != NULL) - { - // Show error message... - NSLog(@"ERROR: %@",error); - CDVPluginResult* result = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:error.description]; - [self.webView stringByEvaluatingJavaScriptFromString:[result toErrorCallbackString: self.callbackId]]; - } - else // No errors - { - // Show message image successfully saved - NSLog(@"IMAGE SAVED!"); - CDVPluginResult* result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString:@"Image saved"]; - [self.webView stringByEvaluatingJavaScriptFromString:[result toSuccessCallbackString: self.callbackId]]; - } -} - -- (void)dealloc -{ - [callbackId release]; - [super dealloc]; -} - - -@end |
