Image cropping help

Unfortunately, we may get into file permissions hell here....

Does your app have permission to overwrite the file?

Was the image file created with your app?

I presume you will be picking the file from Shared Storage somewhere?

You did not say how you will pick the file? (The image picker creates a copy of the file in your ASD)

Or we can do is add an image2 for the cropped image so there will be no issue for overwritten, will this work?

Yes, but you will need to know the directory that the image came from if you want to store the cropped image in the same directory....

I do not want to save the image to the device storage, I want to save the image to tinydb within the app

You cannot save a binary image file to the tinydb, it only accepts strings. What you can do is save a file path, or convert an image file to a base64 string and save that.

Any more requirements that are completely different from your original request ?

Ok, that is all I require

Is it possible to save the cropped image to tinydb list with a tag

I just told you what you can do with an image and tinydb......

Can you send me an aia over this discussion?

These blocks will pick a file from the gallery using image picker, then save the cropped image to the Pictures folder in your ASD, and then display the cropped image:

Ok I got it, I will try this and let you know

This works, Thank you :slight_smile:

How can I make this working with camera after picking, please help me setting up camera image cropping, i am unable to get the logic

These are the blocks, I am not getting the logic

Everything you need is in the topic above.

If you get stuck, show your relevant blocks

you do not say what is not working, or show errors etc.

Example, from above:

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

I am not getting any error, instaed after clicking the camera the image is not getting fetched in the cropview vertical arrangement, the arrangement just remains blank,
The gallery is supporting to fetch and show the image in cropview arrangement but the camera image is not getting fetched in cropview arrangement

For me i am getting an error:

Task java.util.concurrent.FutureTask@15df9ad[Not completed] rejected from java.util.concurrent.ThreadPoolExecutor@fe434e2[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1] Note: You will not see another error reported for 5 seconds

Could be the cropping extension has gone out of date....

Might be better to use Taifun's Image extension.

Try this.
com.sunny.crop.aix (5.2 KB)

Supports uri as well as file path.
It uses crop feature of default camera.

1 Like

Can you share a apk for test of this cropper?