# Image Management vision 8.1

**URL:** <https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823>\
**Category:** Ignition\
**Tags:** scripting, ignition81, vision\
**Created:** [September 7, 2022, 8:50am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823 "2022-09-07T08:50:51Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 7, 2022, 8:50am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/1 "2022-09-07T08:50:51Z")

</div>

**How to print image management image path and image using script**

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 7, 2022, 11:30am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/2 "2022-09-07T11:30:19Z")

</div>

Going to need a little more information.

Where is this image? In an image component on a window?  
Where do you want to print it?

What have you tried and what didn’t work?

Have you looked at `system.print.createPrintJob()`?  
[https://docs.inductiveautomation.com/display/DOC81/system.print.createPrintJob](https://docs.inductiveautomation.com/display/DOC81/system.print.createPrintJob)

---

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 7, 2022, 12:07pm UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/3 "2022-09-07T12:07:54Z")

</div>

I have stored two company logo (T1.png) and (T2.png) format uploaded on Image management in ignition vision 8.1.19 version.

Locally Stored image this location : C:/Users/T1280675/PycharmProjects/Python\_Code/ss.png ( it shows full path of image)

But in ignition vision client running in office server:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/2/12e0dd7198cebc4dbd11016f29a2bbbf98293df0.png)

path shows : Ignition Server.png

but i need C:/Users/ like that location

_ **strong text** _if any function available in ignition directly read image from Image Management \*\*  
_ **strong text** _so please revert me\*\* .

for reference code:

ws.insert\_image(‘A1’, ‘C:/Users/T1280675/PycharmProjects/Python\_Code/ss.png’,{‘x\_offset’:0, ‘y\_offset’:0,‘x\_scale’: x\_scale, ‘y\_scale’: y\_scale}) # Locally stored Image location in PC

ws.insert\_image(‘A1’, ‘ss.png’,{‘x\_offset’:0, ‘y\_offset’:0,‘x\_scale’: x\_scale, ‘y\_scale’: y\_scale}) # ignition Image Mangement location

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [September 7, 2022, 12:17pm UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/4 "2022-09-07T12:17:49Z")

</div>

The whole point of image management is that you upload files from your development machine onto the Gateway, which then makes them accessible to all clients.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 7, 2022, 1:01pm UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/5 "2022-09-07T13:01:08Z")

</div>

Lets start over.

What are you trying to accomplish?

What I think you’re trying to do is to take an image from a client machine and insert it into the image management.

What I don’t understand is why. What is the end goal?

---

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 8, 2022, 4:07am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/6 "2022-09-08T04:07:15Z")

</div>

no i want fetch image from image management during the export excel image will be visible in excel company logo

> > and also upload and download image from image management but script (using ignition function)

---

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 8, 2022, 4:46am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/7 "2022-09-08T04:46:50Z")

</div>

What I think you’re trying to do is to take an image from a client machine and insert it into the image management.  
**NO**

Simple … way …  
I uploaded image into image management , so i want to read path from image management image.  
(it is not copied full path from image management image )

using script ( if any ignition vision functions available , please reply (like system function )

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [September 8, 2022, 6:45am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/8 "2022-09-08T06:45:30Z")

</div>

If you’re trying to program upload and download functionality, then you are probably wanting a file explorer component.

Then, you will probably use code that looks similar to this to guide your user:

```auto
import getpass
stringPath = "C:\\User\\"+getpass.getuser()+"\\Pictures\\"
event.source.parent.getComponent('File Explorer').rootDir = stringPath
event.source.parent.getComponent('Text Field').text = stringPath

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/1/71b52e6a37620b033d0334b0e0c01c551cb30709.png)

---

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 8, 2022, 7:14am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/9 "2022-09-08T07:14:01Z")

</div>

Hello justin edwards

Requirement : Image read from image Management not in local directory

Please go through this code 🙂 (use code in button and check )

from xlsxwriter import Workbook  
#import getpass  
#wb = xlsxwriter.Workbook(‘hello.xlsx’)  
path = system.file.saveFile(‘hello.xlsx’)  
wb = Workbook(path)  
ws = wb.add\_worksheet(“Loading\_Robot\_info”)  
cell\_format = wb.add\_format({‘align’: ‘center’,‘valign’: ‘vcenter’,‘border’:2, ‘border\_color’:‘black’, ‘font\_size’:50,})  
ws.merge\_range(‘A1:H1’, “”, cell\_format)  
image\_width = 50.0  
image\_height = 58.0  
###############  
image\_width1 = 60.0  
image\_height1 = 110.0  
###############  
cell\_width = 64.0  
cell\_height = 20.0  
x\_scale = cell\_width/image\_width  
y\_scale = cell\_height/image\_height

#######################  
x\_scale1 = cell\_width/image\_width1  
y\_scale1 = cell\_height/image\_height1  
#######################  
ws.insert\_image(‘A1’, ‘C:/Users/T1280675/PycharmProjects/Python\_Code/ss.png’,{‘x\_offset’:0, ‘y\_offset’:0,‘x\_scale’: x\_scale, ‘y\_scale’: y\_scale})  
ws.insert\_image(‘H1’, ‘C:/Users/T1280675/PycharmProjects/Python\_Code/ss2.png’,{‘x\_offset’:25, ‘y\_offset’:0,‘x\_scale’: x\_scale1, ‘y\_scale’: y\_scale1})

#stringPath = “C:\User\comp\_logo.png\”  
#stringPath1 = “C:\User\offline\_logo.png\”  
#ws.insert\_image(‘A1’, stringPath,{‘x\_offset’:0, ‘y\_offset’:0,‘x\_scale’: x\_scale, ‘y\_scale’: y\_scale})  
#ws.insert\_image(‘H1’, stringPath1,{‘x\_offset’:25, ‘y\_offset’:0,‘x\_scale’: x\_scale1, ‘y\_scale’: y\_scale1})

ws.set\_column(‘A1:H1’, 50)  
ws.set\_column(‘A2:H2’, 30)  
f0=wb.add\_format({‘bold’:True, ‘border’:2, ‘border\_color’:‘black’,‘bg\_color’:‘#FFFFFF’, ‘font\_size’:50,‘align’:‘center’})  
f1=wb.add\_format({‘bold’:True, ‘border’:2, ‘border\_color’:‘black’,‘bg\_color’:‘#C0C0C0’, ‘font\_size’:20,‘align’:‘center’})  
f2=wb.add\_format({‘border’:2, ‘border\_color’:‘black’,‘bg\_color’:‘#FAF5EF’,‘font\_size’:14,‘align’:‘center’})  
head = [‘History Alarm’]  
headings = [“Scanned\_DateTime”, “Fiche\_Id”, “Parent\_Length”, “Parent\_Width”, “Volume”,“Rack\_Side”,“Status”,“Scanned\_By”]  
data = [[‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘June’],[10, 40, 50, 20, 10, 50],[30, 60, 70, 50, 40, 30],[40, 60, 70, 50, 40, 30],[50, 60, 70, 50, 40, 30],[60, 60, 70, 50, 40, 30],[70, 60, 70, 50, 40, 30],[80, 60, 70, 50, 40, 30],]

ws.write\_row(‘A1’, head, f0)  
ws.write\_row(‘A2’, headings, f1)  
ws.write\_column(‘A3’, data[0],f2)  
ws.write\_column(‘B3’, data[1],f2)  
ws.write\_column(‘C3’, data[2],f2)  
ws.write\_column(‘D3’, data[3],f2)  
ws.write\_column(‘E3’, data[4],f2)  
ws.write\_column(‘F3’, data[5],f2)  
ws.write\_column(‘G3’, data[6],f2)  
ws.write\_column(‘H3’, data[7],f2)  
wb.close()

---

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 8, 2022, 7:15am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/10 "2022-09-08T07:15:08Z")

</div>

![comp_logo](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d7222618c3ed17535b3b7aade0aee48d5cd9f766.png)  
 ![offline_logo](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b807837f2d28f950accc8779a54ae2a5af2fa293.png)

use image

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [September 8, 2022, 7:23am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/11 "2022-09-08T07:23:28Z")

</div>

Please use the \</\> code formatting button when posting code. It will indent properly (important for Python) and give syntax highlighting. You can use the 🖉 edit link to fix your post.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [September 8, 2022, 7:50am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/12 "2022-09-08T07:50:35Z")

</div>

Here is his code properly formatted for the forum:

```auto
#print #event.source.startDate
from xlsxwriter import Workbook
#import getpass
#wb = xlsxwriter.Workbook(‘hello.xlsx’)
path = system.file.saveFile('hello.xlsx')
wb = Workbook(path)
ws = wb.add_worksheet("Loading_Robot_info")
cell_format = wb.add_format({'align': 'center','valign': 'vcenter','border':2, 'border_color':'black', 'font_size':50,})
ws.merge_range('A1:H1', "", cell_format)
image_width = 50.0
image_height = 58.0
###############
image_width1 = 60.0
image_height1 = 110.0
###############
cell_width = 64.0
cell_height = 20.0
x_scale = cell_width/image_width
y_scale = cell_height/image_height

#######################
x_scale1 = cell_width/image_width1
y_scale1 = cell_height/image_height1
#######################
ws.insert_image('A1', 'C:/Users/T1280675/PycharmProjects/Python_Code/ss.png',{'x_offset':0, 'y_offset':0,'x_scale': x_scale, 'y_scale': y_scale})
ws.insert_image('H1', 'C:/Users/T1280675/PycharmProjects/Python_Code/ss2.png',{'x_offset':25, 'y_offset':0,'x_scale': x_scale1, 'y_scale': y_scale1})

#stringPath = “C:\User\comp_logo.png\”
#stringPath1 = “C:\User\offline_logo.png\”
#ws.insert_image(‘A1’, stringPath,{‘x_offset’:0, ‘y_offset’:0,‘x_scale’: x_scale, ‘y_scale’: y_scale})
#ws.insert_image(‘H1’, stringPath1,{‘x_offset’:25, ‘y_offset’:0,‘x_scale’: x_scale1, ‘y_scale’: y_scale1})

ws.set_column('A1:H1', 50)
ws.set_column('A2:H2', 30)
f0=wb.add_format({'bold':True, 'border':2, 'border_color':'black','bg_color':'#FFFFFF', 'font_size':50,'align':'center'})
f1=wb.add_format({'bold':True, 'border':2, 'border_color':'black','bg_color':'#C0C0C0', 'font_size':20,'align':'center'})
f2=wb.add_format({'border':2, 'border_color':'black','bg_color':'#FAF5EF','font_size':14,'align':'center'})
head = ['History Alarm']
headings = ["Scanned_DateTime", "Fiche_Id", "Parent_Length", "Parent_Width", "Volume","Rack_Side","Status","Scanned_By"]
data = [['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June'],[10, 40, 50, 20, 10, 50],[30, 60, 70, 50, 40, 30],[40, 60, 70, 50, 40, 30],[50, 60, 70, 50, 40, 30],[60, 60, 70, 50, 40, 30],[70, 60, 70, 50, 40, 30],[80, 60, 70, 50, 40, 30],]

ws.write_row('A1', head, f0)
ws.write_row('A2', headings, f1)
ws.write_column('A3', data[0],f2)
ws.write_column('B3', data[1],f2)
ws.write_column('C3', data[2],f2)
ws.write_column('D3', data[3],f2)
ws.write_column('E3', data[4],f2)
ws.write_column('F3', data[5],f2)
ws.write_column('G3', data[6],f2)
ws.write_column('H3', data[7],f2)
#wb.close()

```

---

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 8, 2022, 8:07am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/13 "2022-09-08T08:07:43Z")

</div>

Thanks you

---

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 8, 2022, 8:09am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/14 "2022-09-08T08:09:26Z")

</div>

yes justin edwards

---

<div class="post-metadata">

**Author:** ![TANVEER\_AHMAD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@TANVEER\_AHMAD](https://forum.inductiveautomation.com/u/TANVEER_AHMAD)\
**Post date:** [September 8, 2022, 10:23am UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/15 "2022-09-08T10:23:39Z")

</div>

Hope you my question understand !

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 8, 2022, 1:12pm UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/16 "2022-09-08T13:12:38Z")

</div>

One thing that will have to be tackled here is that the images in Image management are stored on the gateway and so this will have to be done in the gateway scope. Unless you only have a single or only a handful of Vision clients and then you **could** locally put copies of these images on their machines but it would have to be in an identical path directory to make sure the client script works. I wouldn’t trust the clients to not move these around though so I don’t recommend this method.

I was just looking to see where the images of image management are stored but I can’t find them. However, you don’t really need them in image management to do this.

I think the following steps would be sufficient:

1. Put the images you want somewhere on the server your gateway is on
2. Create a gateway message handler. This is where you will run the script. The paths to the images are where you just put them on your gateway server.
3. Append the following to your new gateway message handler script

```auto
filePath = "hello.xlsx" # or whatever the real path is - this surely can't be the full path
fileData = system.file.readFileAsBytes(filePath) # This gets the file data
project="YourProjectNameHere"
# It's important that both Gateway and Client versions of this message handler have been created
messageHandler="FileCreated"
scope="C"
myDict = {'fileData': fileData}
results=system.util.sendMessage(project,messageHandler,myDict,scope) # This sends the file data to the client directly

```

1. Create a client message handler called `FileCreated` (or whatever you want but what you call it should match `messageHandler="FileCreated"`). This message handler will get triggered when the gateway sends the file data to your client. So here you probably want something like

```auto
fileData = payload['fileData'] # This is the file bytes that the gateway sent back to the client after making the file
path = system.file.saveFile("myFile.xlsx") # allows client user to select path where they want to save the file
if path is not None:
   system.file.writeFile(path, fileData)

```

So the whole sequence of events here is the client does something, a button press or similar (I am assuming is triggered by a client for this example), tells the Gateway hey make this XLSX file, the Gateway, which has access to these images (so the clients don’t need them), creates your XLSX file, and then sends that file data back to the client, who can then save it where they want.

The last thing you would need to change in your script would be

```auto
ws.insert_image(‘A1’, ‘C:/Users/T1280675/PycharmProjects/Python_Code/ss.png’,{‘x_offset’:0, ‘y_offset’:0,‘x_scale’: x_scale, ‘y_scale’: y_scale})
ws.insert_image(‘H1’, ‘C:/Users/T1280675/PycharmProjects/Python_Code/ss2.png’,{‘x_offset’:25, ‘y_offset’:0,‘x_scale’: x_scale1, ‘y_scale’: y_scale1})

```

To point to where the images are located on your Gateway server.

---

<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:** [September 8, 2022, 1:15pm UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/17 "2022-09-08T13:15:17Z")

</div>

> [@bkarabinchak.psi](#):
>
> I was just looking to see where the images of image management are stored but I can’t find them.

They are stored in the gateway's internal database as blobs, IIRC.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 8, 2022, 1:17pm UTC](https://forum.inductiveautomation.com/t/image-management-vision-8-1/63823/18 "2022-09-08T13:17:15Z")

</div>

I thought that might be the case. Probably easier than to do what he needs with them if he just leaves them as images on his gateway server in some folder as it seems his script expects a path to the images.
