Image to Base64 Extension

Yes ! It is indeed a great example ! Thank you for using the extension !

Like @ILoveThunkable asks, does it lag when you use the EncodeImage and DecodeImage function ?

Encode image for a size up to 1Mb on an old alcatel touch pop c5 smartphone is fast and the button save to become ready again takes maybe a half second, the decoding is faster and no apparent delay is perceptible. If there are a lot of big sized images, the lag could be effective. If the operation is not serialized or involves images sized less than 500Kb, there should not be too much evident lag. The better solution is to make the operation asyncronous, with specific separate blocks, like e.g. those ones in @Taifun file extension.


Can you try using 3MB?


1 Like

ok no problem, really fast, but I had to change smartphone to Xiaomi Redmi Note 3, cause I have no memory left on Alcatel and cannot erase anything

1 Like

As soon as I have more time, I would like to play with taifun asyncronous task and look at it, trying to combine the block with @Sivagiri_Visakan ’ ones

1 Like

What’s that?


I remember this one, and somewhere ,if I’m not wrong, @Taifun did another type of async. task , in another extension. At this point , Taifun , if you read these posts, I would like if you express your opinion and maybe you could really help.


Well, it seems I found a solution to make the task of encode/decode image asynchronous. See this blocks. They work, but I’m still not really sure of the benefits of such a solution.
Why? Listen: I used one of Taifun’s File extension block (the less time-code-execution expensive, I think) to nest in it the task of encode/decode the image . To verify that there’s a benefit I should create a loop which would repeat the operation on a series of image (I’ll do it but now my time is over: I’ve to go away for lunch!).


I mean there is no lag, if you want to encode and decode. But try to set the text of Label to EncodeImage

The purpose of the blocks is to encode an image, save in tinyDB and retrieve it decoded when needed. If the purpose is reached without causing delays in the general “front” operation of the app, that’s a good result. There’s no need to see the string encoded in a text label or elsewhere. Though, has to be still checked the effectiveness of a loop repeated on a series of images.

1 Like

Can you do, what I am asking for?

Can you explain a bit more what you are asking for ?


@Tiziano1960 Thank you very much for all your examples and tests with this extension …

1 Like

Why do you need to set the text of a label to a base64 string ? It will be very long text and won’t make any sense to the end user
The lag occurs when you try to set the text to a very long string ( like the base64 encoded string ) as the process takes a few seconds

I will see if I can add a block to run async tasks in the extension with the help of @Tiziano1960 example …

Well, when I try to encode an image and set Web component’s url to it & then use POST it will lag my app for minimum of minute.

Uhmm. :thinking:
So I guess this is not an issue with the extension…

I will try out a few things with the POST block and let you if I have something

If I wanted to create a php file to get this code, what would I do?

What do you mean?