About ceiling calculation?

Hi all.
it may no need a new post?

under when.ImageConvertor1.AfterResizeImage:
set.gloabl.totalBytes to length.get.global.base64String2;
set.global.totalChunks to ceiling: get.global.totalBytes/100;

this got totalChunk=59 by length of base64String=5952. why? should be 60?

thanks

You have already been provided with two working solutions for chunking your base64.

To answer your question about the ceiling function:

image

image

image

1 Like

Thanks.

  1. tested the two solutions, all got ERROR: Bad arguments to < the operation <cannot accept the arguments:, [1], [[:/9j.....; seems that transfer the list instead of items of the list, maybe I used it wrong? the use block attached below.

  2. the block attached in the post was from a working code which works great for take screenshot encode and transfer completed. don't why not works here, I mean take picture decoded...

  3. displaied by Label that: totalChunk=59 by length of base64String=5952. its why post, as you also confirn it should be 60.

thanks

splitStringToChunk:

call splitStringToChunk:
dre1

sendnextchunk:

Your second block does not look correct?

If you are resizing an image, AFTER you resize it you want to convert the resized image to base64, then chunk that string?

1 Like

Here is an example:

resizebase64chunk.aia (185.4 KB)

Blocks

Screen

1 Like

thanks.

yes: take pictureToBase64-decode-resize-encode-send chunk. can you tell how to midify the second block? that input the base64String and sign the splitStringToChunk list to chunkList; and send 'START' to start the transfer. the global.chunkIndex to 0 or 1 both failed to send.

BTW. my test result: take pictureToBase64-decode-resize-encode-send chunk, all works well except the last step to send the chunk by chunk, it stucked at last chunk,

another thing is, the image size set: 100, and quality: 100, transfer never success;
size set: 100, and quality: 50; or size set: 50, and quality: 100, some times transfer good, why?

thanks.
I'll test.