Store Base64 Image data to a Tag?

I’m considering storing Base64 image strings to a tag and then just using the data in the tag to show the image within Perspective. I have not tried this, yet. The images are 40-50 KB.

I guess I’m wondering if anyone wants to talk me out of it in favor of a more traditional approach. i.e. store the image in blob/s3 storage and display via a get request. or maybe write the image data to a SQL table directly.

It kind of “feels” like a bad idea – I also haven’t checked to see what the string value character limit is for a tag but that could be the limiting factor.

Any thoughts out there?

Hi @donfmorrison, I suppose it comes down to scale (the number of images you have) and what you have access too.

I mainly use the “store the image in blob” method personally. You can do this without WebDev, but you may see a performance impact for large amounts of images. You can also place the images into \Ignition\webserver\webapps\main\ but this can be a nightmare to manage the files dynamically (resources get locked, etc.), in my experience.

If you have access to WebDev module you can mount a folder and access them from there, or use it to embed the images from your DB.

I would recommend against this - it’ll probably fit into the character limit of an individual tag just fine, but it’s putting a lot of additional load on your internal DB (which is pretty important, given it holds all of your other configuration). I’d use a dedicated DB (you could even use the built-in SQLite driver to store in a bespoke SQLite file, for easy portability).

1 Like