Image (Component)
The Image object lets you manage the images that are displayed in your web pages. Generally, an image must be 'created' within CommonSpot after it is uploaded. ('Create' means that you are making it available to CommonSpot.) After CommonSpot knows about an image, you can 'create' new versions of it, change its owner, delete it, move it, and so on. This object also provides methods for obtaining information on the image and which pages refer to it, the subsite in which it resides, and so on.
Methods marked below with [L] may be logged at the site level (if transaction logging is licensed and enabled by the administrator)
Methods marked below with [C] may be customized at the site level
Methods:
changeOwner [L] [C] | Changes an image's owner. |
checkVersionResizeRequired [C] | Returns a boolean value indicating if making an old version current needs a image resize or not. |
createFromData [L] [C] | Create a base64 representation of an image and assigns it the attributes contained within this method's arguments. |
createNewVersionFromData [L] [C] | Creates a new version of a base64 image representation and assigns it the attributes contained within this method's arguments. |
delete [L] [C] | Deletes an image. |
exists [C] | Returns true if the image exists with the specified image ID, false otherwise. |
generateWebP [L] [C] | 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. |
getBase64DataForImageURL [C] | Method to get base 64 data for a provided image URL. |
getImageSizePaths [C] | Method to get the paths to images of all sizes for a particular image. |
getInfo [C] | Returns a structure containing general (and considerable) information about an image. |
getMoveToGalleryConflicts [C] | Method to get the conflicts reasons for moving images from one gallery to another. |
getOwnerID [C] | Returns an image owner's user or group ID. |
getPictureHTML [C] | Returns HTML string containing a picture tag for specified image at the specified size. If the WebP generation is enabled and the WebP image if missing it will be generated on the fly and included in the picture tag.. |
getReferringObjects [C] | Returns zero or more structures, each containing information on elements that refer to this image. This method's arguments limit the amount of information CommonSpot returns. |
getReferringObjectsCount [C] | Returns the number of objects referring to this image. This number only includes the objects that are identified by this method's arguments. |
getRenderInfo [C] | Returns a detailed ImageInfo structure containing information about the image needed for rendering. |
getSubsiteID [C] | Returns the ID of the subsite in which the image resides. |
getVersionList [C] | Returns one or more structures, each containing information about an image's versions; for example, the image's description, file name, version time stamp, and so on. |
makeVersionCurrent [L] [C] | Makes the specified version the image's active version. |
move [L] [C] | Moves an image to the current subsite. |
moveToGallery [L] [C] | Method to move images from one gallery to another. |
saveInfo [L] [C] | Updates standard metadata for the specified image. |