Fallback Image Path

I am wondering if there is a simple method to set a fallback image if the path does not return an image from image manager. If I could view the image bytes that would be sufficient information, or if there was something like system.file.fileExists but for the image manager. I understand that these images are in the internal database and not at a file path.

for example, if I dynamically set the image path like this /system/images/Pictures/Wheels/{scanData}.png
I need a fallback image for that path.

Or is the actual method to just store my images as BLOBs in my own DB?

You can use this script transform to find if the image with given name exists:

def transform(self, value, quality, timestamp):
	from com.inductiveautomation.ignition.gateway import IgnitionGateway
	from com.inductiveautomation.ignition.gateway.images import ImageRecord
	
	imageManager = IgnitionGateway.get().getImageManager()
	return value in [image.getString(ImageRecord.Path) for image in imageManager.getImages('')]

Or you can use this 3rd party module:
Automation Professionals’ Blob Server Module

2 Likes