# Perspective: Base64 Image into Table

**URL:** <https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [August 4, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684 "2022-08-04T15:42:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryoungk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryoungk/32/24205_2.png) [@ryoungk](https://forum.inductiveautomation.com/u/ryoungk)\
**Post date:** [August 4, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684/1 "2022-08-04T15:42:22Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/b/ebfa65e02eb61ee04d5501e5aa1f6022c3f0099d.png)

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

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/6/669b2f969710e1f0937a47df8c4cfed986190cea.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fd33002ce9b3f53d7eeb9134bdde11c44efba86b.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 4, 2022, 3:49pm UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684/2 "2022-08-04T15:49:23Z")

</div>

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](https://forum.inductiveautomation.com/t/automation-professionals-blob-server-module/57970).

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 4, 2022, 3:54pm UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684/3 "2022-08-04T15:54:41Z")

</div>

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:

> **[Data URLs - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)**
>
> Data URLs, URLs prefixed with the data: scheme, allow content creators to embed small files inline in documents. They were formerly known as "data URIs" until that name was retired by the WHATWG.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 4, 2022, 3:57pm UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684/4 "2022-08-04T15:57:42Z")

</div>

> [@paul-griffith](#):
>
> make a data URI

Meh. Expect godawful performance for all but trivial cases.

---

<div class="post-metadata">

**Author:** ![ryoungk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryoungk/32/24205_2.png) [@ryoungk](https://forum.inductiveautomation.com/u/ryoungk)\
**Post date:** [August 4, 2022, 6:10pm UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684/5 "2022-08-04T18:10:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [August 5, 2022, 2:31pm UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684/6 "2022-08-05T14:31:02Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![SR\_Solar](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@SR\_Solar](https://forum.inductiveautomation.com/u/SR_Solar)\
**Post date:** [August 18, 2022, 7:39am UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684/7 "2022-08-18T07:39:26Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/5827464f0e09809663943431e8378b8fa8cbd2ea.png)

---

<div class="post-metadata">

**Author:** ![ryoungk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryoungk/32/24205_2.png) [@ryoungk](https://forum.inductiveautomation.com/u/ryoungk)\
**Post date:** [September 13, 2022, 12:49pm UTC](https://forum.inductiveautomation.com/t/perspective-base64-image-into-table/62684/8 "2022-09-13T12:49:09Z")

</div>

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](https://forum.inductiveautomation.com/t/automation-professionals-blob-server-module/57970/2)
