Harris Hu Posted Thursday at 11:55 AM Report Posted Thursday at 11:55 AM 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 Thursday at 02:11 PM Report Posted Thursday at 02:11 PM (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 Thursday at 03:04 PM by ensegre typo Quote
ShaunR Posted Thursday at 02:19 PM Report Posted Thursday at 02:19 PM 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 Thursday at 02:28 PM Report Posted Thursday at 02:28 PM (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 Thursday at 02:30 PM by Neil Pate 1 Quote
ensegre Posted Thursday at 03:04 PM Report Posted Thursday at 03:04 PM 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 Thursday at 03:09 PM Author Report Posted Thursday at 03:09 PM 39 minutes ago, Neil Pate said: LabVIEW 自带的气象站示例就展示了这一点。 但这些数据并非Base64编码,而只是纯字符数据。 This is acceptable. Quote
ensegre Posted Thursday at 03:17 PM Report Posted Thursday at 03:17 PM 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
ShaunR Posted 7 hours ago Report Posted 7 hours ago (edited) On 1/8/2026 at 3:17 PM, ensegre said: 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? There is an example shipped with LabVIEW called "Image Compression with DCT". If one added the colour-space conversion, quantization and changed the order of encoding (entropy encoding) and Huffman RLE you'd have a JPG [En/De]coder. That'd work on all platforms Not volunteering; just saying Edited 7 hours ago by ShaunR 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.