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
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
nice
adding several ExtraValue blocks results in overwriting, so only the last one will make it in the end…
also the ExtraValue block is deprecated… you might want to use the Extras block instead, see an example here how to use it App Inventor Code Snippets | Pura Vida Apps
and btw. the image extension also offers a free Crop method…
Taifun
Nice, Nice
This is impressive.
EDIT: The Extras do not change anything. I might be wrong…
Here are the changes @Taifun proposed
com.android.camera.action.CROP
image/*
android.intent.category.DEFAULT
"crop","true"
"return-data",true
"aspectX",100
"aspectY",100
"outputX",255
"outputY",255
Excelent, bro
you might want to try to remove the Extras block completely… probably it’s not required at all?
another thing to try is
Taifun
I actually tried this, but without the “” and it didn’t work
Nice. Now, with an AIA to make the life easier:sunglasses:
Crop_Source.aia (2.8 KB)
Can’t we do anything so it only crops square image. BTW this was nice
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?
Have you accepted the permissions in the app settings?
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
add for example the file component to your project
Taifun
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
I tried @Dramon_Reyes’ code and these three lists as inputs to ActivityStarter.Extras
, but none of them work.
the example project by @fabioirmao worked fine for me on Nexus 5x running on Android 8.1 using the companion app
Taifun
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
Thank you ^^. It helps me a loooooot~~