From c4009429a40a03f8cb5eaa2601bd7e134432fed1 Mon Sep 17 00:00:00 2001 From: StefanoMagrassi Date: Tue, 5 Jan 2016 12:02:48 +0100 Subject: [PATCH 1/3] removed useless log message from Android class --- src/android/Base64ToGallery.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/android/Base64ToGallery.java b/src/android/Base64ToGallery.java index ab0afa7..0459425 100644 --- a/src/android/Base64ToGallery.java +++ b/src/android/Base64ToGallery.java @@ -53,9 +53,7 @@ public class Base64ToGallery extends CordovaPlugin { filePrefix = DEFAULT_FILE_PREFIX; } - // Create the bitmap from the base64 string - Log.d("Base64ToGallery", base64); - + // Create the bitmap from the base64 string byte[] decodedString = Base64.decode(base64, Base64.DEFAULT); Bitmap bmp = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); @@ -99,9 +97,6 @@ public class Base64ToGallery extends CordovaPlugin { + c.get(Calendar.MINUTE) + c.get(Calendar.SECOND); - - Log.i("Base64ToGallery", "Android version " + deviceVersion); - int check = deviceVersion.compareTo("2.3.3"); File folder; From ec45e6aabb59e0a752037eef7b10ff33d5176a01 Mon Sep 17 00:00:00 2001 From: StefanoMagrassi Date: Tue, 5 Jan 2016 12:13:26 +0100 Subject: [PATCH 2/3] removed useless log messages from iOS class --- src/ios/Base64ToGallery.h | 1 - src/ios/Base64ToGallery.m | 29 +++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ios/Base64ToGallery.h b/src/ios/Base64ToGallery.h index 54322d3..245fde7 100644 --- a/src/ios/Base64ToGallery.h +++ b/src/ios/Base64ToGallery.h @@ -7,7 +7,6 @@ // MIT Licensed // - #import @interface Base64ToGallery : CDVPlugin diff --git a/src/ios/Base64ToGallery.m b/src/ios/Base64ToGallery.m index b8d9438..5d0c7c1 100644 --- a/src/ios/Base64ToGallery.m +++ b/src/ios/Base64ToGallery.m @@ -25,26 +25,28 @@ NSData* imageData = [NSData dataFromBase64String:[command.arguments objectAtIndex:0]]; UIImage* image = [[[UIImage alloc] initWithData:imageData] autorelease]; - UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); + UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); } - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { + CDVPluginResult* result = nil; + // Was there an error? - if (error != NULL) - { - // Show error message... - NSLog(@"ERROR: %@",error); - CDVPluginResult* result = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:error.description]; + if (error != NULL) { + NSLog(@"ERROR: %@", error); + + 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]]; + + // No errors + } else { + + result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK]; + + [self.webView stringByEvaluatingJavaScriptFromString:[result toSuccessCallbackString: self.callbackId]]; } } @@ -54,5 +56,4 @@ [super dealloc]; } - @end From d0f536a8b94b21f2109dbec665d1160e56b08f24 Mon Sep 17 00:00:00 2001 From: StefanoMagrassi Date: Tue, 5 Jan 2016 12:16:00 +0100 Subject: [PATCH 3/3] removed useless log messages from WP8 class --- src/wp8/Base64ToGallery.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp8/Base64ToGallery.cs b/src/wp8/Base64ToGallery.cs index f6cbed3..c7518f4 100644 --- a/src/wp8/Base64ToGallery.cs +++ b/src/wp8/Base64ToGallery.cs @@ -37,7 +37,7 @@ public class Base64ToGallery : BaseCommand if (picture.Name.Contains(fileName)) { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "Image saved: " + picture.Name)); + DispatchCommandResult(new PluginResult(PluginResult.Status.OK)); } else {