Accessing images in Image Manager through scripting

Is there any way to access the images in the Image Manager through scripting at runtime? Currently I can access the images if they are on a shared drive “\\shared drive\image.extension” or by storing the raw bytes for an image in a Python list “byteList = [byte0, byte1, …, byteN]”. Through some searching I was able to find the following information in JavaDocs but not sure how to actually access and instance of the ImageManager.
http://files.inductiveautomation.com/sdk/javadoc/ignition79/795/com/inductiveautomation/ignition/gateway/images/ImageManager.html
I am not a Java developer so some of the terminology might be off.

The first question is, what does ‘accessing images’ mean? Reading the data, to display on a page? Adding, removing, deleting? Also, what scope do you want to access the images in? If it’s from the client/designer, there are a lot more hurdles than on the gateway.

This thread has some useful information:

Oh, and let me say up front this time - doing anything where you have to interact with the API will not be supported by support. That’s not to say that it’s actually bad, but careless use of internal methods could lead to unintended consequences.

Sorry for the confusion. I need to display it on a custom popup in Vision. I am not trying to manipulate the image in any way. Attached I have the script I am currently using. I would like to use an image that I uploaded to the Image Manager in the same manner. This is to avoid any file share permissions issues that we run into sometimes. I believe I will need to access it from the client unless there is a way to pass the image to a client from the gateway after the gateway retrieves the image.

Alert.py (3.1 KB)

If you just need to display an image from image management, then all you need is the image component. Just update the path property to whatever the path is to your image in image management:
https://docs.inductiveautomation.com/display/DOC80/Vision+-+Image

2 Likes

That worked. I was able to import and instantiate the PMIImage component instead of PMILabel in my script and use its setPath method to browse and display the images from Image Management.
Thank you for your help.