Square crop method with the activity starter

Hi, I wanted to know if it is possible to create with the activity starter a method that allows you to crop perfect and fixed squares from an image chosen from the gallery.

yes itā€™s possible, See here:

I have already looked at this topic, but none of the methods used work (I have read every single post), so I have opened my topic in search of a real solution

What happens exactly?


I tried to use this method with the activity starter in 3 different types, however the crop area does not remain fixed, but can still be modeled and made a rectangle or a line.
I am looking for a method with the activity starter that cuts me a precise portion which, enlarged or not, always remains of that shape

You can use another methods for cropping like the crop method here:
https://puravidaapps.com/image.php
Or this block here:
https://docs.kodular.io/components/drawing-and-animation/image-editor/#scale-center-crop

I know these methods, they just cut the image by default after it has been chosen in the gallery.
This however prevents me from being able to choose where to cut, and how big or small for each individual image, so they are not suitable.

with the activity starter I can call the CROP method of the camera for each single image, but the shape does not remain fixed, and even inserting data such as ā€˜aspectā€™ or ā€˜outputā€™ behaves as if they do not exist.

you canā€™t pass boolean or long values using the defaut activity starter


Taifun

1 Like

Hi Taifun, well, Iā€™ll try to use XActivityStarter for call a crop method with specific settings (like output and aspect), but thereā€™s a problem.


In this image I use in DataUri the Join block with ā€œfile://ā€, and the app, at the moment who choise the image, fall into the ā€œintent.getData()ā€ error.
Without the Join Block and ā€œfile://ā€ string, appear the message ā€œimage editing is not supportedā€
This kind of problems are discuss in my previous topic, where I have used the ā€œCropImageā€ extension, so please tell me: where am I wrong?

read the already mentioned thread completely to fix the errors in your blocks
Taifun

This post was flagged by the community and is temporarily hidden.

sometimes there is no simple solution to a problemā€¦
sometimes someone needs to play around, try some thingsā€¦
someone else already went through several steps and we got close to the solution in that other threadā€¦
sorry, you will be the one to try things outā€¦ I will not do your workā€¦ it does not look like you even took a quick look at the other threadā€¦ else you could realize, that your blocks do not really make sense

good luck!

I now joined your duplicate threadā€¦ I recommend you to not start a new thread with the same subject againā€¦ see also the posting guidelinesā€¦ you donā€™t want to be suspended from the community, do you?

Taifun

2 Likes

This post was flagged by the community and is temporarily hidden.

try this com.ammar5287.Cropimage.aix (8.6 KB)

Thank you SO MUCH for this extension, but with this blocks, the app fall into the ā€œintent.getData()ā€ error.

is correct to do this? or I make an error? what do you think about it?

use 1 in aspectheight and aspectwidth

Ok l do this


but the ā€œintent.getData()ā€ problem exist again.