Can I reduce the resolution of image files?

Here you are Martin, try this, let me know how it goes...
Events for conversion and resize, returns the filePath (same as the "output" you supply)

uk.co.metricrat.imageconvertorV5.aix (9.0 KB)

1 Like

Great TIM. Thanks a lot. It's very usefull.
I tested the .AfterImageResized block and it works.
Now we can be sure of not having timing issues.

Unfortunatelly my old tablets can't resize big files (their limit is somewhere between 1 and 2 MB, but sometimes they succed whith some 3 MB file).
But companion told me the Runtime Error it's due to lack of memory.
image
I'm ordering a new tablet, with more power and Android11.

A couple of updated extensions for you to test/try

ImageConvertor, which now returns file sizes for target and output, and a formatted option

uk.co.metricrat.imageconvertorV7.aix (10.1 KB)

FileSize which returns the file size of a file, as bytes or formatted

uk.co.metricrat.filesizeV2.aix (4.7 KB)

Works for me.

Resize_7.aia (13.0 KB)

1 Like

Thanks Tim.
Nice to have new features.
I tested the .Resize and .AfterImageResized blocks, and they work as expected.

Just a little suggestion (to get close to perfection, in case your keep improving the extension):
To order the same way both the event type and the procedure type blocks in the drawer (I made a mistake, and dragged the .AfterImageConverted block instead)

I have no control over that, AppInventor sorts methods and events blocks, although it is odd that they are not alphabetical. I will try AfterResizeImage / AfterConvertImage see if that makes a difference.

Here you are :wink:

image

uk.co.metricrat.imageconvertorV8.aix (10.1 KB)

1 Like

Gorgeous

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

With the release of version 190 / 190a, the camera picture is now, once again, returned as a file with the .jpg extension, (instead of a png).

1 Like