From 54b49cf243134428da626b7261fd3bb5d574d20d Mon Sep 17 00:00:00 2001 From: Bohdan Shcherbak Date: Wed, 29 Nov 2017 16:31:29 +0100 Subject: [PATCH 1/3] Add NSPhotoLibraryUsageDescription to info.plist from plugin.xml --- plugin.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin.xml b/plugin.xml index 6e812f6..19a19c3 100644 --- a/plugin.xml +++ b/plugin.xml @@ -33,6 +33,10 @@ + + Save images into gallery + + From 678fe55d2c90283b57505ebc2ed51933f2b188ea Mon Sep 17 00:00:00 2001 From: Bohdan Shcherbak Date: Mon, 11 Dec 2017 12:46:47 +0100 Subject: [PATCH 2/3] add jpeg,png,jpg,bmp & gif compatibility --- README.md | 5 ----- www/base64ToGallery.js | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index e16ec71..24c11b4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,3 @@ -# :warning: DISCONTINUED - Cordova base64ToGallery Plugin -This plugin (based on [devgeeks/Canvas2ImagePlugin](http://github.com/devgeeks/Canvas2ImagePlugin)) allows you to save base64 data as a png image into the device (iOS Photo Library, Android Gallery or WindowsPhone 8 Photo Album). - -The plugin is a kind of fork of the [solderzzc/Base64ImageSaverPlugin](https://github.com/solderzzc/Base64ImageSaverPlugin) but with a cleaner history (a.k.a: no tags from Canvas2ImagePlugin repo) and a newer iOS implementation. - ## Alerts ### Plugin id - [issue #1](https://github.com/Nexxa/cordova-base64-to-gallery/issues/1) diff --git a/www/base64ToGallery.js b/www/base64ToGallery.js index efb7111..c8347aa 100644 --- a/www/base64ToGallery.js +++ b/www/base64ToGallery.js @@ -36,7 +36,7 @@ module.exports = function(data, options, success, fail) { var actionArgs = prepareArgs(spec); // Prepare base64 string - data = data.replace(/data:image\/png;base64,/, ''); + data = data.replace(/^data:image\/(jpeg|png|jpg|bmp|gif);base64,/, ""); // And add it to the Service's Action arguments actionArgs.unshift(data); From 8d75be23c9f6a7e5ef66e6310d702cfa07f03f97 Mon Sep 17 00:00:00 2001 From: Leonardo Monteiro Fernandes Date: Fri, 4 May 2018 15:49:20 +1000 Subject: [PATCH 3/3] Added NSPhotoLibraryAddUsageDescription for iOS --- plugin.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index 19a19c3..945cb76 100644 --- a/plugin.xml +++ b/plugin.xml @@ -33,8 +33,14 @@ + + + $PHOTOLIBRARY_ADD_USAGE_DESCRIPTION + + + - Save images into gallery + $PHOTOLIBRARY_USAGE_DESCRIPTION