Image.generateWebP (Method)

Generates the WebP version of the image specified. If WebP is not enabled for the gallery that the image in included in, an error this thrown. Otherwise, a structure is returned that will contain a StatusCode with one of the following values: 0 - generation failed, 1 - generation was successful, 2 - WebP image exists. If the StatusCode is 1 or 2 an ImageInfo structure will be returned with information about the image that will be used for rendering.

Returns:

Image_GenerateWebP_Result (struct)

Each row of the returned query results has the following fields:

Field Name Type Description
ImageInfo ImageInfo If the StatusCode is 1 or 2 the key will be returned with information about the image that will be used for rendering.
StatusCode Integer_0_to_2 Indicates the status of webP version - 0 - webP generation failed, 1 - webP generation was successful, 2 - WebP image exists.

Arguments:

Name Type Required Description
imageID ImageID Required ID of an image.
skipIfExists Boolean Optional. Defaults to '1'. Boolean value indicating if CommonSpot should skip generating the WebP version if the WebP version already exists.

Context:

License Requirements (none)
Permission Requirements (none)
Deny Context (none)
Require Context AuthoringEnabled
Author Lock (not required)
Transaction Logging If transaction logging is enabled at the site level, calls to this method will be logged
Customization This method may be customized at the site level

Error Codes:

Code Error Message
24513 Maintaining and rendering WebP is not enabled on the gallery for the image.

Notes:

None