Class BeThumb
Thumbnail utilities class
Methods summary
public
|
|
public
|
|
private
|
|
public
|
#
image( $data, $params = array(), $skipCheck = false )
Returns image URI after resample (thumbnail version of the input image data provided) Creates thumbnail image in $config['mediaRoot']/cache dir if thumb not created or outdated If a cache configuration 'thumbs' is found presence check is done through cache and not on filesystem (S3 optimization) |
protected
boolean
|
|
public
true
|
#
setupImageInfo( array & $data )
Setup internal imageInfo data array On error $data['error'] is populated with: - 'notFund' if image is missing or unreachable - 'unsupported' if image format is not supported |
public
|
#
imagePathCached( $imageFilePath = null )
Get image file path, get cached local copy behind a proxy |
private
|
|
private
|
|
private
array
|
|
private
|
|
private
|
|
public
|
#
thumbnailSize( unknown $thumbPath )
Get thumbnail size in bytes reading from cache or filsystem Input thumbnail path should be relative to media root (not includin media root) May use cached data |
private
|
|
private
boolean
|
|
private
boolean
|
|
private
string
|
|
private
boolean
|
|
private
string
|
#
checkLocalThumbCacheDirectory( )
Check local thumb target cache directory existence and create it if missing |
private
array
|
#
getCropCoordinates( integer $origW, integer $origH, integer $targetW, integer $targetH, string $position )
calculate cropping coordinates (top, left) |
private
|
|
private
|
|
private
boolean
|
|
protected
boolean
|
#
isExceedingSize( integer $size )
Check whether file size is exceeding size limits for image thumbnail generation. |
private
string
|
Properties summary
private
array
|
$supportedTypes
|
#
array(
'image/gif' => 'gif',
'image/jpeg' => 'jpg',
'image/pjpeg' => 'jpg',
'image/png' => 'png',
'image/svg+xml' => 'svg'
)
|
private
array
|
$imageInfo
Source image data |
#
array()
|
private
array
|
$imageTarget
Target image data (thumbnail) |
#
array()
|
private
|
$imgMissingFile
Link to "missing image" url img (could be different in backend o frontend) |
#
null
|
private
|
$imgUnsupported
Link to "unsupported mime" url image (could be different in backend o frontend) |
#
null
|
private
|
$mediaRoot
Path to BEdita media root |
#
null
|
private
|
$localThumbRoot
Path to local root folder used for writing thumbs if null $this->mediaRoot is used |
#
null
|
private
array
|
$inputParams
Input params passed to image() method gor thumb creation |
#
array()
|
public
array
|
$allowedParams
List of allowed input params |
#
array(
'width', 'height', 'fillcolor', 'longside', 'mode', 'modeparam', 'type', 'upscale',
'cache', 'watermark', 'quality', 'interlace',
)
|
public
array
|
$ignoredParams
List of input params to ignore |
#
array('presentation', 'URLonly')
|
private
array
|
$knownMimeTypes
All known mime types internal use (if needed), read from config/mime.types.php |
#
array()
|
private
boolean|null
|
$cacheDirChecked
It says if cache dir for thumbnail has been already checked and created.
Its value is |
#
null
|