Skip to main content

system.kanoa.cmms.getWorkOrderEventImageThumbnail(workOrderEventImageId)

Retrieves only the thumbnail byte data for a single work order event image record, identified by its workOrderEventImageId. This is a lighter-weight alternative to getWorkOrderEventImage for cases like preview grids or list views where the full-resolution image is not needed. Like the other get* image functions, it returns the raw bytes directly rather than a (result, message) tuple.


Parameters

workOrderEventImageId Integer: Id of image to retrieve


Returns

image byteArray


Example

# Populate a thumbnail preview grid for a list of work order event images without pulling down the full-resolution bytes.

workOrderEventImageIds = [9137, 9138, 9139]

for imageEventId in workOrderEventImageIds:
thumbBytes = system.kanoa.cmms.getWorkOrderEventImageThumbnail(imageEventId)
if thumbBytes is not None:
# e.g. add to a template repeater's dataset for a thumbnail grid
print 'Loaded thumbnail for image id %d (%d bytes)' % (imageEventId, len(thumbBytes))
else:
print 'No thumbnail found for image id %d' % imageEventId