Hello,
I want to store base64 data in a memory tag so that an image source can use this data to display a PNG format picture. I encoded a PNG to binary, and then my Python IDE provided an ASCII representation. I copied and pasted this into a memory tag as a string and bound this to the image source.
What might be wrong with this design?
- What is the proper format for the tag?
- How can I bind the image source with a base64 string?
Thank you!
Well, you're gaining nothing by formatting down to base64, for one. If you are going to store it in a tag, just use a byte array tag. But also, don't use a tag.
If it's a relatively static image, use the built in image management. If it's a relatively dynamic image, you should probably store it in a dedicated database table and use Webdev or Phil Turmel's blob server module to host it.
You don't want to store large amounts of data in a memory tag because then the gateway has to store that large memory tag's data, inefficiently encoded as JSON, within it's internal database. Tag loading throughout the rest of the system will likely suffer as a result.