FREE crop image code


#1

Hello everyone, this is my first post, and I would like to share with you this code in blocks for the crop of images I hope it is very useful, if someone is encouraged to make a donation, I would be very grateful.

Dramon


Image Cropping Extension needed
The extension of cropping the image
Image Cropping Extension needed
#2

nice


#3

adding several ExtraValue blocks results in overwriting, so only the last one will make it in the end…
Unbenannt

also the ExtraValue block is deprecated… you might want to use the Extras block instead, see an example here how to use it https://puravidaapps.com/snippets.php#2contact

and btw. the image extension also offers a free Crop method…

Taifun


#4

Nice, Nice


#5

This is impressive.


#6

EDIT: The Extras do not change anything. I might be wrong…

Here are the changes @Taifun proposed


Here are the texts for copy and paste

com.android.camera.action.CROP
image/*
android.intent.category.DEFAULT
"crop","true"
"return-data",true
"aspectX",100
"aspectY",100
"outputX",255
"outputY",255

#7

Excelent, bro


#8

you might want to try to remove the Extras block completely… probably it’s not required at all?

another thing to try is
Unbenannt
Taifun


#9

I actually tried this, but without the “” and it didn’t work


#10

Nice. Now, with an AIA to make the life easier:sunglasses::sunglasses:
Crop_Source.aia (2.8 KB)


[Paid] Zoom, rotate, drag image
#11

Can’t we do anything so it only crops square image. BTW this was nice :+1:


#12

Does this work for anyone in apk? It works in Live Testing, but when I export apk, it throws error "java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content [...] requires android.permission.READ_EXTERNAL_STORAGE". Any idea on how to get this permission?


#13

Have you accepted the permissions in the app settings?


#14

My app seems to not request them. Only camera access can be granted. The strange thing is that my FileAlt extension should request that…

PS: Here is the line of code in my extension that should request this permission


#15

add for example the file component to your project
Taifun


#16

I’ve tried it on several phones with different versions and it works very well with exception of:

‘aspectX’, 100
‘aspectY’, 100
‘outputX’, 255
‘outputY’, 255


#17

I tried @Dramon_Reyes’ code and these three lists as inputs to ActivityStarter.Extras, but none of them work.


If anybody has been successful in implementing a square crop method with the ActivityStarter, please let me know


#18

the example project by @fabioirmao worked fine for me on Nexus 5x running on Android 8.1 using the companion app
Taifun


#19

The ratio isn’t fixed on my Moto E (1st Gen) running Android 5.1 nor my Moto G (3rd Gen) running Android 6.0.1


#20

Thank you ^^. It helps me a loooooot~~ :heart_eyes: