See the App Inventor Extensions document about how to use an App Inventor Extension.
For questions about this extension, bug reports and feature requests, please start a new thread in the App Inventor Extensions forum. Thank you.
Mar 22th, 2016: Initial Version 1 as of 2016-03-22 for App Inventor version ai2extensions7 and Companion version 2.36cdk1
Aug 11th, 2016: Version 1a: avoid DX execution failed error: build each extension separately
Aug 17th, 2016: Version 2: crop method added
Image Extension for basic image manipulation (2 methods available, more might follow).
Required permissions: android.permission.READ_EXTERNAL_STORAGE, android.permission.WRITE_EXTERNAL_STORAGE
Returns whether Warnings should be suppressed
Specifies whether Warnings should be suppressed
Resize a jpg image file.
You can use a relative path or a complete path to the image file. To use a relative path, just prefix the imageFileName with /. For instance /myFile.jpg will shrink the file /mnt/sdcard/myFile.jpg. You can't shrink files in the assets. If a fileName starts with file:/// you can specify a complete path to the file.
Thank you Tanja for being the sponsor of this block!
Crop Image. Enter the distance in pixel for left, top, right and bottom.
Thank you Husain for being the sponsor of this block!
Create chunks of a jpg image file.
For example rows=4 and columns=3 will create 12 chunks of the original image, see screenshot
The chunks will be stored in the same directory as the original image file. The following name convention will be used: imageFileName_rowNumber_columnNumber.jpg.
You can use a relative path or a complete path to the image file. To use a relative path, just prefix the imageFileName with /. For instance /myFile.jpg will create chunks of the file /mnt/sdcard/myFile.jpg. You can't create chunks from files in the assets. If a fileName starts with file:/// you can specify a complete path to the file.
Event indicating that chunks have been created. A list of filenames will be provided as result.
Note: the larger image (on the left) looks like it is smaller compared to the shrinked image (on the right).
I currently do not know why this happens, actually the same size in the image component should be displayed...
Some more blocks to get the current image size, width and height using the Image Metadata Extension
displaying chunk # 5 out of 12 chunks created (4 rows and 3 columns)
I can help you: for one hour I charge 25 USD.
Please contact me at info [at] puravidaapps [dot] com for details!
For questions about App Inventor, please use the App Inventor forum. Thank you.
If you find this example helpful and you are using it in one of your projects,
be nice and donate a small amount!
or donate some mBTC to Address:
Thank you! Taifun
This work by Pura Vida Apps is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
with attribution (name=Pura Vida Apps and link to the source site) required.