Reference > Functions reference > Container functions > GetThumbnail
 

GetThumbnail

Returns a thumbnail image of the content in a container field, according to a specified height and width.

Format 

GetThumbnail ( field ; width ; height )

Parameters 

field - any expression that returns container data.

width - the maximum width for the thumbnail.

height - the maximum height for the thumbnail.

Data type returned 

container

Originated in version 

12.0

Description 

Returns an image as container data that’s no larger than the specified values for width and height. The thumbnail image always maintains the proportions of the original image and has a resolution of 72 dpi. Thumbnails cannot be made larger than the image’s original size.

Notes 

This function returns a thumbnail image only if the Generate and store thumbnails for images option is selected in the Manage Containers dialog box. If this option is deselected, the image is returned at its original size. See Managing performance with thumbnails.

If the field parameter does not specify a field that contains image data, field must evaluate to the file path of an image. See Creating file paths.

Example 1 

Exports a thumbnail with a maximum height and width of 50 points.

Set Field [Invoices::ExportContainer ; GetThumbnail ( Invoices::Container ; 50 ; 50 )
Export Field Contents [Invoices::ExportContainer ; Create folders: Off]

Example 2 

Creates a thumbnail, exports it, and attaches it to an email.

Set Field [Invoices::ExportContainer; GetThumbnail ( Invoices::Container ; 50 ; 50 )
Set Variable [$ATTACHMENT; Value:Get ( TemporaryPath ) & GetContainerAttribute ( Invoices::ExportContainer ; "filename" )]
Export Field Contents [Invoices::ExportContainer; "$ATTACHMENT" ; Create folders: Off]
Send Mail [Send via E-mail Client; With dialog: Off; To: Customers::Email; "$ATTACHMENT"]

Related topics 

Functions reference (category list)

Functions reference (alphabetical list)

About formulas

About functions

Defining calculation fields

Using operators in formulas