Image component cannot load path to a compressed image

I used the extension "com.devyb.devybimagecompressor.aix"(refer to [FREE] Image Compressor - Compress large images into smaller sized images - Extensions - Kodular Community) to compress the selected image from ImagePicker, and then I tried to load the compressed image into Image interface, but failed. I cannot find solution after research. Welcome any help.

Here is more details:

After selected a image from ImagePicker, the image shows up correctly. The highlight is the full path of the selected image.
微信图片_20211231233205
the blocks as below:

After image compressed, the compressed image cannot be shown.
aftercompress
the blocks are below, the highlights is the full path of the compressed image.

And screen already asked external storage read and write permission.

Thanks.

Use an image component to show global file path.

Edit: Sorry I misunderstood your question.

as per what i can guess is that aicount folder does not exist or it is because your path is not ending with / instead aicount can you put
Download/ remember to end with /

Since → targetSdkVersion = 30 you can no longer create an arbitrary folder on Android 11+. So save in one of the Shared folders (like /Pictures or /Documents or /Download ...).

@Aarush_Kumar @Anke
Thanks a lot, this question is caused by the file path on Android, I changed the "/storage/emulated/0/aicount" to following options:

  1. "/storage/emulated/0/aicount/", not work
  2. "/storage/emulated/0/Pictures", not work
  3. "/mnt/sdcard/Pictures", worked, see below screenshot:
    1641087401(1)

Thanks again.

2 Likes

On which device & Android version?
/storage/emulated/0/ should work on all Android versions!

Maybe the full path is neeeded on your device:

file:///storage/emulated/0/Pictures

I tried this on Emulator, here is result:

for "/storage/emulated/0/Pictures", not work, same result on real device with Android 10
1641117445(1)

for "file://storage/emulator/0/Pictures", not work
1641117532(1)

for "/mnt/sdcard/Pictures", works
1641117875(1)

This is working for me on Android 10 in companion (2.62u)

It was already suggested by @Anke to use a full path :slight_smile:

2 Likes

Thanks, it is solved on my device with your code, but failed on emulator, it seems the emulator's issue.

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