Perspective: Base64 Image into Table

I have a base64 image coming in from a DB to a table in Perspective. I am wondering if it is possible to render the column as a view that would display the image. I am stuck at receiving the value from the render properties. The view.params.value doesn’t pass the value from the DB. Also, I am not sure of the format of this to display the base64 image. Any help would be appreciated.

Also, the following is what I setup for the render and view incoming parameters.


If you can coerce the DB to deliver raw bytes instead of Base64, you might use an image component in a subview combined with my Blob Server Module.

If you know the filetype of the base64 data, you could prefix it to make a data URI, which you would be able to directly use as the source property of an image component:

Meh. Expect godawful performance for all but trivial cases.

2 Likes

How can I access the data from that element? Referencing the view.params.value just produces ‘value’ but I am looking for the actual data stored in that cell of the DB?

Does it just produce value in the designer or the session as well (you can test this by launching your project in a session and throwing some labels with bindings on the Image view)?

If it helps this is what I do to display base64 images in a perspective image component.
Note the image type (png/jpg etc.) doesn’t seem to matter.
Also it seems to be best to avoid holding images in perspective custom properties and only load them in directly to the image component when needed as this reduces gateway memory usage.

Thanks for all of the comments. I ended up using a 3rd party module to do it and it works great. Automation Professionals' Blob Server Module - #2 by pturmel

3 Likes