# Display blob image from database

**URL:** <https://forum.inductiveautomation.com/t/display-blob-image-from-database/14507>\
**Category:** Ignition\
**Created:** [June 13, 2017, 7:18pm UTC](https://forum.inductiveautomation.com/t/display-blob-image-from-database/14507 "2017-06-13T19:18:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [June 13, 2017, 7:18pm UTC](https://forum.inductiveautomation.com/t/display-blob-image-from-database/14507/1 "2017-06-13T19:18:37Z")

</div>

I have been looking over code in these forums to load an image from the mysql database and have not had much success, I am using version 7.9.2

can anyone share code to display this in a paintable canvas, label, or image component?

here is my query:

```auto
presentation = event.source.parent.getComponent('Dropdown').selectedLabel
rowSlide = event.source.parent.currentSlidePath

image = system.db.runScalarPrepQuery("SELECT photo FROM presentations where presentation=? and series_name = ?", [presentation, rowSlide])

```

---

<div class="post-metadata">

**Author:** ![abishur](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/abishur/32/9096_2.png) [@abishur](https://forum.inductiveautomation.com/u/abishur)\
**Post date:** [June 14, 2017, 1:58pm UTC](https://forum.inductiveautomation.com/t/display-blob-image-from-database/14507/2 "2017-06-14T13:58:47Z")

</div>

I did this also, check this thread here:

> [@Load image from DB into Image object](http://forum.inductiveautomation.com/t/load-image-from-db-into-image-object/12309):
>
> I’ve successfully followed the examples on the forum to upload an image into an SQL database as a BLOB. I’ve also been able to create a custom property of type dataset on my window that successfully reads the BLOB into itself. I’m stuck on the last step though, now that I’ve got this, how can I put an Image Display object on the screen and display the BLOB inside it?

for the code I used and the solution provided to me to get it to work correctly.

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [June 14, 2017, 5:43pm UTC](https://forum.inductiveautomation.com/t/display-blob-image-from-database/14507/3 "2017-06-14T17:43:47Z")

</div>

Thanks abishur,  
I saw your post and tried that earlier with no luck. I keep getting some errors.

File “event:propertyChange”, line 18, in   
AttributeError: ‘NoneType’ object has no attribute ‘width’

---

<div class="post-metadata">

**Author:** ![abishur](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/abishur/32/9096_2.png) [@abishur](https://forum.inductiveautomation.com/u/abishur)\
**Post date:** [June 14, 2017, 6:40pm UTC](https://forum.inductiveautomation.com/t/display-blob-image-from-database/14507/4 "2017-06-14T18:40:50Z")

</div>

Can you post the code you’ve done as a reference?

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [June 14, 2017, 7:00pm UTC](https://forum.inductiveautomation.com/t/display-blob-image-from-database/14507/5 "2017-06-14T19:00:34Z")

</div>

Edit:

The problem was that I did not save the blob correctly in the database. The label code is good though.
