Cropping images using a Cordova plugin



Asley Cruz
Hi David,
I would like to use a plugin to crop an image selected from gallery and to show
the cropped image in an Image control in AB1.

You can use the below plugin or another cordova plugin:
cordova-plugin-crop-with-ratio
I found this plugin but I wasn't able to make it works :/

Hoping it is possible. Thanks a lot in advance. Have a nice week.
AsleyCruz.com

Graphic & Web Designer


David

Hello Asley,

I did not try the plugin that you refer, however, what is the problem? What do you try? Do you get any error message? Are you try to follow the plugin's documentation? Are you try with a device connected to the PC, so you may can see some debug information? I will try to help you if you provide a bit more of information!


Consider to purchase one or more licenses of our products if they are useful to you!

Asley Cruz
Hi David,
Sorry for the delay... I tried to start the plugin but it seems it does not work. I don't know what I am doing wrong :/
My app "Quotes" works with images but I would like to use this plugin (or any other) to crop images in AB1.
If you can make it work, maybe you want to add it in Samples folder.

Thanks, thanks & this is how the plugin should look:

AsleyCruz.com

Graphic & Web Designer


David

Hello Asley,

The problem if you did not provide any information, is not only that you force me to start to deal with the plugin from the scratch, but, also, that I don't know the possible context, so, maybe my effort is non useful. This is common in support forums, Asley: we must try to provide as much information as possible about the possible error, so other people can try to help us in the best way.

Trying the plugin, I can get it working at the first time, without any remarkable problem. Below you can see a modification of the Camera sample app, which uses the plugin to crop the captured photo / image: copy the below code in a file like "Camera.ab" and then open it with AB1, compile it and finally try it in an Android device:

I hope the above can be useful for you, at least to give you some idea. On the other hand, there are various "crop images" JavaScript libraries that maybe you can consider to use, so you get something working not only in the supported plugin platforms, but in almost all the platforms. Please, post here if you have any further question about this. And don't hesitate to do it, since I will try to help you if possible.


Consider to purchase one or more licenses of our products if they are useful to you!

Asley Cruz
Many thanks, David
I am not used to install extra plugins in AB but your sample works like a charm.
I also tried this JS library called "Cropper" and works great too, 100%.

CropperJS

Have a nice month.
AsleyCruz.com

Graphic & Web Designer


David

Hello Asley,

So finally you got it? I did not try the JavaScript library that you refers, but certainly it's one of the first results searching in Google here too. :-)


Consider to purchase one or more licenses of our products if they are useful to you!

Asley Cruz
Yes David, I got it :)
Thanks a lot ehhh. Take care a lot.
AsleyCruz.com

Graphic & Web Designer


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.