Image optimizer : Optimize images and reduce it's size

What is the issue you are facing?

When I take a photo and then try to compress it with the extension and then save it in Firebase, the error shown in the image appears, I clarify that I do not use the emulator, but rather install the .apk on a smartphone.
But, when I use the image selector it does work properly.


345

Try removing the file:/.

very soon after App Inventor targets SDK30 you will not be able to access the root directory of the device anymore...
@Kumaraswamy the extension should store the optimized image in the ASD...

Taifun

1 Like

I'm using defaultValue: /storage/emulated/0/compressed.png but with the .jpg at the end, something like that /storage/emulated/0/compressed.jpg
and the permissions are fine, i didn't add them, but the system asks me to authorize memory access.

I solved it, apparently the extension works with a path without file://, and the camera block returns a path like: file:///storage ..., so you just have to remove that from the path, and ready.
Thank you very much for enlisting my help guys, I appreciate it very much.

1 Like

7 posts were split to a new topic: Image Optimizer Extension and Kodular issue

Hi,
Sorry I don’t know how to use the extension.
It would be very helpful if you could provide .aia file.
I’d like to compress photos and upload photos to Google Drive at the same time.

Hi, what have you tried? :sweat_smile:

Sir

It is no problem when I tried to upload photo to Google Drive ,but it’s fail if I resize photo file size and upload photo to Google Drive.

I want to try to resize photo and upload to Google Drive , not only upload photo.

:grin: :grin: :grin:

I tried to upload photo to Google Drive. ↓↓↓

Upload photo to Google Drive Upload photo
and
Base64 .aix

And studied to resize photo file size. ↓↓↓

Photo Resize

it’s fail if I resize photo file size and upload photo to Google Drive. I have been trying to figure out this question for three months but still have no idea.

  1. Please show your relevant blocks
  2. Where is your image coming from - the camera ?

Using an image in the assets I have it working here:
I used my ImageBase64 extension to get the base64String from the optimised image displayed in the image component

Script as follows:

function doPost(e) {
    var data = Utilities.base64Decode(e.parameters.data);
    var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
    var fileID = DriveApp.getFolderById(e.parameters.folderId).createFile(blob).getId();
    return ContentService.createTextOutput(fileID);

    }

Hi Sir

My blocks ↓

my photo upload to Google Drive .aia

  1. My image from to imagepicker.

This .aia is Chinese.

I know your blocks, it's photo upload

Thank you.

But, I want to try to resize photo and upload to Google Drive, not only upload photo.

:grin: :grin: :grin:

Yes, my blocks optimise (resize) then upload.

Looks like you are trying to upload four images at once. This will not work. Do them one at a time in a loop, using the Web1.GotText to start the next upload.

Sir

Your Button1 is resize image and Button2 is upload image?

:thinking::thinking::thinking:

Sorry, my English is not good.

:joy::joy::joy:

Yes, that is correct.

Sir

I don't have your block base64...

my use base64
image