[Camera Plugin] Crop

[Camera Plugin] Crop

  
Forge Component
(11)
Published on 26 Sep by OutSystems R&D
11 votes
Published on 26 Sep by OutSystems R&D

Hi, 

Please add possibility to use native crop capabilities.

Can you point me to how I can tweak this plugin to enable this functionality?

Thank you.

Hi Mykola,

You can try to create a wrapper for an apache cordova plugin that has the function you need, give a look in the Cordova or github sites.


Hi Diogo, 

Sure I can use another plugin but have this functionality in supported plugin would be much better.

Currently we use mobile cropper plugin but as there is a built-in crop functionalities on both Android and iOS it make sense to have it in this camera plugin and not rely on another one.

Solution

Hi Mykola,

you can try to set the alloEdit flag to True, this way the user will take a photo and after set that photo as OK, it will redirect the user to the photo app in cropping mode.

Cheers,
Miguel

Solution

Hi Miguel, nice to hear from you :)

That was exactly setting I was looking for and it is working. 

Thank you.

Hi Mykola, same from this side! Glad that worked as needed!

Cheers.

Hi Miguel.

Can you please tell me where can I find the alloEdit flag? I can't find it. 

Thank you.

Hi Andreia,

You can add allow edit in the 

TakePictureJS node in TakePicture action of Camera Plugin

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/index.html

Andreia Penedo wrote:

Hi Miguel.

Can you please tell me where can I find the alloEdit flag? I can't find it. 

Thank you.


Andreia,

Use my oml, the alloEdit flag is an input from cordova plugin

Hi Andreia,

you need to create a custom action where you will be using the parameters that are hardcoded in the plugin. Or you use the custom version of this plugin already created by Rui here:

https://www.outsystems.com/forums/discussion/26213/camera-plugin-parameters-hardcoded/

Let us know if you need more help on this.

Cheers,
Miguel

You guys, went to fast on this! :D

Thank you guys for the fast responses. 

It worked :D, but I want to allow the user to select the part of the image that he wants to save while he has the camera open.

Is it possible?

 

You can use FilePlugin https://www.outsystems.com/forge/component/1633/file-plugin/ to save files

Mykola (Nick) Tkachenko wrote:

You can use FilePlugin https://www.outsystems.com/forge/component/1633/file-plugin/ to save files

Mykola, thank you for your help but I need something different.

Using the previous examples I get the following behavior:

1 - The user opens the camera

2 - He takes the picture

3 - He uses the crop plugin to select the area of the image that he wants to use.



I want something like this:

1 - The user opens the camera with the crop functionality already displayed

2 - He adjusts the crop box

3 - He takes the picture.


Thank you.



Hi Guys, 


I am using the Same Camera Plugin https://www.outsystems.com/forge/component/1390/camera-plugin/ from forge.


I am able to crop image using allowEdit property. But if i select the image from phone library , the allowEdit property does not work and user can no longer have the ability to crop the image selected from the device.


I have already raised this question in forum. But if anyone of you can able to address this issue then it will be great help. 

https://www.outsystems.com/forums/discussion/40986/camera-plugin-allowedit-option-is-not-supported-while-choosing-photo-from-phone/

Regards,

Akshay Tank .

Miguel 'Kelter' Antunes wrote:

Hi Mykola,

you can try to set the alloEdit flag to True, this way the user will take a photo and after set that photo as OK, it will redirect the user to the photo app in cropping mode.

Cheers,
Miguel

Thanks for your reply. The allowEdit function is very useful. It works very well in the Android app, but not in iOS app. To enhance the cropping function, I have changed the width & height TakePictureJS inside the TakePhoto Client logic in CameraPlugin Module to A4 ratio instead of the default square shape. It turns out I can crop the image in A4 shape in my native Android app, but the native iOS app remains square shape as default.