You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by no...@apache.org on 2024/10/30 12:48:25 UTC

(cordova-plugin-camera) branch master updated: deprecation: allowEdit (#914)

This is an automated email from the ASF dual-hosted git repository.

normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-camera.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c9dc10  deprecation: allowEdit (#914)
4c9dc10 is described below

commit 4c9dc105128a44708d91f168e5e7dab827930e79
Author: Norman Breau <no...@breautek.com>
AuthorDate: Wed Oct 30 09:48:20 2024 -0300

    deprecation: allowEdit (#914)
    
    * deprecation: allowEdit
    
    * applied suggestions to verbiage
---
 README.md     | 2 +-
 www/Camera.js | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 281b122..c5e21ec 100644
--- a/README.md
+++ b/README.md
@@ -307,7 +307,7 @@ Optional parameters to customize the camera settings.
 | quality | <code>number</code> | <code>50</code> | Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.) |
 | destinationType | <code>[DestinationType](#module_Camera.DestinationType)</code> | <code>FILE_URI</code> | Choose the format of the return value. |
 | sourceType | <code>[PictureSourceType](#module_Camera.PictureSourceType)</code> | <code>CAMERA</code> | Set the source of the picture. |
-| allowEdit | <code>Boolean</code> | <code>false</code> | Allow simple editing of image before selection. |
+| ~~allowEdit~~ | <code>Boolean</code> | <code>false</code> | **Deprecated**. Allow simple editing of image before selection. |
 | encodingType | <code>[EncodingType](#module_Camera.EncodingType)</code> | <code>JPEG</code> | Choose the  returned image file's encoding. |
 | targetWidth | <code>number</code> |  | Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant. |
 | targetHeight | <code>number</code> |  | Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant. |
diff --git a/www/Camera.js b/www/Camera.js
index 5c0627a..1e6b5ca 100644
--- a/www/Camera.js
+++ b/www/Camera.js
@@ -143,6 +143,10 @@ cameraExport.getPicture = function (successCallback, errorCallback, options) {
     const popoverOptions = getValue(options.popoverOptions, null);
     const cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
 
+    if (allowEdit) {
+        console.warn('allowEdit is deprecated. It does not work reliably on all platforms. Utilise a dedicated image editing library instead. allowEdit functionality is scheduled to be removed in a future release.');
+    }
+
     const args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
         mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org