Base64 extension help

How to use these blocks

Just trying to convert image to Base64 and vice-versa

Tried other way:

I want to convert image from image picker to Base64 and the base64 need to be displayed in the textbox

This may be #OffTheTopic  , but I wanted to say that I may not be able to Reply to you for few weeks

Because I am going to be busy, but if you help, 


it would be Good

Most image files will generate a very long string.

Google Sheets cells can only hold a maximum of 50,000 characters.

Most image file base64 encoded strings are greater than 50,000 characters

Unless you have a complicated string splitting/combining routine and a script to recover the split strings from the sheet, storing base64 encoded images in google sheets is not a practical solution.

You can use the extension to encode to base64 and then upload the image to your google drive, creating a link which can be set to a google sheet.

1 Like

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

Re-opened this Topic because Hisham hit an issue that was not solved and I have the same issue, extension returns "File not Found". In Hisham's case, it was a file selected via the ImagePicker. In my case, it's a photo taken with the Camera:

ScreenshotPhotoToBase64

Issue is the same, Companion and APK.

PhotoBase64.aia (15.4 KB)

You tried this block?

image

also replace FileToString with this

image

Explain ?

Erm, exactly as said - Hisham only wanted to use Base64 so he could store an image in a Google Sheet - since he can't store a Base64 string there, it's not required.

Looks like my copy of the extension is old, those Blocks are not there. However, in the real App, the photo is taken programmatically, using Taifun's extension, at regular intervals, no User required :slightly_smiling_face:

you will need to convert to base64 if saving an image to google drive....

function doPost(e) {

    var data = Utilities.base64Decode(e.parameters.data);
    var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
    DriveApp.getFolderById('<YOUR FOLDER ID HERE>').createFile(blob);
    return ContentService.createTextOutput("Your File Successfully Uploaded");

    }

You could try my rework of the procam extension, which saves to base64

I have photos saved on Google drive via my Windows PC - we can't do the same from Android? Actually I think Sunny's Google Drive extension might. Anyway, I'm not trying to put the images anywhere in the cloud.

I will take a look at procam, sounds good. The photos themselves are stored/forwarded as-is, but Base64 is currently my route to the Exif data.

Where can I find the Documentation for procam?

Here

Do you know if I can re-initialize camera type? e.g. start with front camera, then change to back camera?

1 Like

Yes, you should be able to change camera then re-initialise the interface.

Always freaks me out when I accidently press the switch camera button on my phone and get the selfie camera :wink:

..... are you really that scary? :joy: