Public Member Functions | Protected Member Functions

BeThumb Class Reference

Thumbnail utilities class. More...

List of all members.

Public Member Functions

 getValidImplementations ()
 image ($data, $params=array())
 image public method: embed an image after resample and cache
 setupImageInfo (array &$data)
 Setup internal imageInfo data array On error $data['error'] is populated with:

  • 'notFund' if image is missing or unreachable
  • 'fileSys' on a local filesystem related error
  • 'unsupported' if image format is not supported.

 imagePathCached ($imageFilePath=null)
 Get image file path, get cached local copy behind a proxy.

Protected Member Functions

 setupImagePath (array &$data)
 Setup image path.
 isExceedingSize ($size)
 Check whether file size is exceeding size limits for image thumbnail generation.

Detailed Description

Thumbnail utilities class.

Definition at line 25 of file be_thumb.php.


Member Function Documentation

BeThumb::image ( data,
params = array() 
)

image public method: embed an image after resample and cache

Parameters:
 array $data, required, source image data (may be BE media object or other source) - required "uri"
 array $params extra info about $params:

width, height, longside, optional: [integer] if no parameters is set, use default width & height in bedita.ini.php (['image']['thumbWidth'], ['image']['thumbHeight']) if longside is set, width & height are ignored and mode is forced to resize. if only width or only height is specified, the mode and modeparam are ignored and forced to 'resize'.

mode, optional: [crop, croponly, resize, 'fill', 'stretch'] if not specified default bedita.ini.php (['image']['thumbMode']) is used (but always overrided by the rules above). 'fill' is legacy options: it will set mode always to 'resize' but modeparam to 'fill' only if longside is not set. 'stretch' is legacy options: it will set mode always to 'resize' and modeparam to 'stretch'.

modeparam, optional: [fill, stretch, 'C', 'T', 'B', 'L', 'R', 'TL', 'TR', 'BL', 'BR'] depends on mode: if resize: 'fill' or 'stretch' and if left empty do simple resize. if crop, a string describing crop zone 'C', 'T', 'B', 'L', 'R', 'TL', 'TR', 'BL', 'BR' (default: ['image']['thumbCrop'] )

cache, optional: [true, false] allow the caching of images, default in bedita.ini (['image']['cache'] )

bgcolor, optional: [string] string representing hex color, i.e. 'FFFFFF' for the background (only on mode=resize and modeparam=fill) default in bedita.ini (['image']['background'] )

upscale, optional: [true, false] allow or not upscale. default bedita.ini.php (['image']['thumbUpscale'])

type, optional: ['gif'/'png'/'jpg'] force image target type (default the same as original)

watermark, optional: [array: 'text', 'font', 'fontSize', 'textColor', 'background', 'file', 'align', 'opacity' ] add simple watermark to image, the missing parameters are replaced with the defaults in bedita.ini (['image']['wmi']* )

Returns:
: string, resampled and cached image URI (using $html helper)

Definition at line 171 of file be_thumb.php.

References isExceedingSize(), setupImageInfo(), and setupImagePath().

BeThumb::isExceedingSize ( size  )  [protected]

Check whether file size is exceeding size limits for image thumbnail generation.

Parameters:
int $size File size.
Returns:
bool

Definition at line 837 of file be_thumb.php.

Referenced by image().

BeThumb::setupImageInfo ( array &$  data  ) 

Setup internal imageInfo data array On error $data['error'] is populated with:

  • 'notFund' if image is missing or unreachable
  • 'fileSys' on a local filesystem related error
  • 'unsupported' if image format is not supported.

Parameters:
array $data
Returns:
true on success, false on error

Definition at line 254 of file be_thumb.php.

References imagePathCached().

Referenced by image(), and imagePathCached().

BeThumb::setupImagePath ( array &$  data  )  [protected]

Setup image path.

Parameters:
array $data
Returns:
bool Success.

Definition at line 214 of file be_thumb.php.

Referenced by image(), and imagePathCached().


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:46 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus