Get an image in data:image/png;base64,iVBOR.... format

Hello everybody

I have a problem in a workflow. I recovered with Palladian node the urls of the university logos in png format but I would like to recover the image in data:image/png;base64 format.

I went through the node string to uri, files to binary objects but then I don’t know how to do it.

Does anyone have any ideas?

Thank you in advance,

Best regards,

Chris

Do you want to encode or decode Base64? For both, there’s nodes in the latest release:

–Philipp

1 Like

Hi Philipp,

I would like to encode. Thanks for your help. I’m going to look at the two nodes you suggest.
Have a nice sunday.
Best regards,
Chris

Let me know how that goes. One additional hint: If you want to generate data: URLs, you’ll need to add the prefix manually. The encoder node will just generate the Base64 portion! :slight_smile:

Have a good Sunday you too!

–Philipp

Hello Philip,

I tried the “base 64 encoder” node but it doesn’t work.

However I found a way using the “read images” node to read the image url. I checked SVG and png in the node. Then with the “table view” node, I see the base 64 address without the prefix data:image/png;base64. But this one is not is not in the output table .

I don’t know how to retrieve it from the “table view” node.

Do you have an idea?

Best regards,

Chris

I cannot try it myself currently, but the following should actually work:

  1. Use a HTTP Retriever to download the image. It’ll provide the result as binary data,
  2. Connect the Base64 Encoder to convert to Base64.

Generally, the Base64 encoder can work with any kind of binary data input.

3 Likes

Sorry, I didn’t put it in the right place. It’s ok now

Thank you very much for your help

Best regards,

Chris

2 Likes

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