setImageAspectRatio()

Defines the aspect ratio for gallery images.

Syntax

setImageAspectRatio(
   id SMALLINT,
   ratio DECIMAL(5,2) )
  1. id is the gallery identifier, as returned by the create() function.
  2. ratio is the aspect ratio to be used (for example, 1.77 or 16/9).

Usage

For all display types except FGLGALLERY_TYPE_SLIDESHOW, in order to align image elements properly when image resources have different sizes, the fglgallery uses the same size for each image.

The size of image elements is defined by the FGLGALLERY_SIZE_* parameter passed to the display() function. This size parameter is relative to the current font size (em unit is used in HTML).

The setImageAspectRatio() function defines the aspect ratio for fglgallery image elements.

The id parameter is the fglgallery handler returned by the create() function.

The display() function has to used after setImageAspectRatio() to have the changes in the fglgallery take effect.

The aspect ratio is ignored when using the FGLGALLERY_TYPE_SLIDESHOW display type. For other display types, a square aspect ratio (1:1) is used by default.

Example

CALL fglgallery.setImageAspectRatio( id, 16/9 )