Harris Hu Posted 22 hours ago Report Posted 22 hours ago 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 Quote
ensegre Posted 20 hours ago Report Posted 20 hours ago (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 19 hours ago by ensegre typo Quote
ShaunR Posted 20 hours ago Report Posted 20 hours ago 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. Quote
Neil Pate Posted 20 hours ago Report Posted 20 hours ago (edited) The Weather Station example that ships with LabVIEW shows a bit of this. but the data is not Base64, its just a pure characters, Edited 20 hours ago by Neil Pate 1 Quote
ensegre Posted 19 hours ago Report Posted 19 hours ago As for converting jpg streams in memory, very long time ago I have used https://forums.ni.com/t5/Example-Code/jpeg-string-to-picture/ta-p/3529632 (windows only). At the end of the discussion thread there, @dadreamer refers to https://forums.ni.com/t5/Machine-Vision/Convert-JPEG-image-in-memory-to-Imaq-Image/m-p/3786705#M51129, which links to an alternative WinAPI way. Quote
Harris Hu Posted 19 hours ago Author Report Posted 19 hours ago 39 minutes ago, Neil Pate said: LabVIEW 自带的气象站示例就展示了这一点。 但这些数据并非Base64编码,而只是纯字符数据。 This is acceptable. Quote
ensegre Posted 19 hours ago Report Posted 19 hours ago You could also check https://github.com/ISISSynchGroup/mjpeg-reader which provides a .Net solution (not tried). So, who volunteers for something working on linux? 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.