Jump to content

How to load a base64-encoded image in LabVIEW?


Recommended Posts

Posted

I received some image data from a web API in Base64 format. Is there a way to load it into LabVIEW without generating a local file?

There are many images to display, and converting them to local files would be cumbersome.

base64.txt is a simple example of the returned data.

image/jpeg

base64.txt

Posted (edited)

I haven't tried any of them, but these are the first 3 results popping up from a web search:
https://forums.ni.com/t5/Example-Code/LabVIEW-Utility-VIs-for-Base64-and-Base32Hex-Encoding-Using/ta-p/3491477
https://www.vipm.io/package/labview_open_source_project_lib_serializer_base64/

https://github.com/LabVIEW-Open-Source/Serializer.Addons (apparently the repo of the code of the previous one)

Edited by ensegre
typo
Posted
2 hours ago, Harris Hu said:

I received some image data from a web API in Base64 format. Is there a way to load it into LabVIEW without generating a local file?

There are many images to display, and converting them to local files would be cumbersome.

base64.txt is a simple example of the returned data.

image/jpeg

base64.txt 4.3 kB · 1 download

LabVIEW can only draw PNG from a binary string using the PNG Data to LV Image VI. (You'd need to base64 decode the string first)

I think there are some hacky .NET solutions kicking around that should be able to do JPG if you are using Windows.

Posted (edited)

The Weather Station example that ships with LabVIEW shows a bit of this.

image.png.ffe4d5b49dee96d1edb4556879f32622.png

 

but the data is not Base64, its just a pure characters,

 

image.png.1cb20b27c8a88607e0b27997aca906f7.png

Edited by Neil Pate
  • Like 1
Posted
39 minutes ago, Neil Pate said:

LabVIEW 自带的气象站示例就展示了这一点。

image.png.ffe4d5b49dee96d1edb4556879f32622.png

 

但这些数据并非Base64编码,而只是纯字符数据。

 

image.png.1cb20b27c8a88607e0b27997aca906f7.png

This is acceptable.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.