UNA
|
Public Member Functions | |
isMimeTypeSupported ($sMimeType) | |
getFileUrl ($mixedHandler) | |
getFileMimeType ($mixedHandler) | |
getFileUrlNotReady ($mixedHandler) | |
isFileReady ($mixedHandlerOrig, $isCheckOutdated=true) | |
getSize ($sFile) | |
transcode ($mixedHandler, $iProfileId=0) | |
Public Member Functions inherited from BxDolTranscoder | |
onDeleteFileLocal ($iFileId) | |
onDeleteFileOrig ($mixedHandler) | |
registerHandlers () | |
unregisterHandlers () | |
cleanup () | |
getStorage () | |
getDb () | |
getFileUrlById ($mixedHandler) | |
prune () | |
forceDevicePixelRatio ($i) | |
getDevicePixelRatio () | |
getOrigFileUrl ($mixedHandler) | |
getTmpFilename ($sOverrideName=false) | |
clearLog () | |
addToLog ($s) | |
getLog () | |
deleteFromQueue ($mixedHandler) | |
storeTranscodedFile ($mixedHandler, $sTmpFile, $iProfileId) | |
getDevicePixelRatioHandlerSuffix () | |
getFilterParams ($sName) | |
getMaxResizeDimention ($sFilter='Resize', $sKey='') | |
isMobile () | |
Static Public Member Functions | |
static | getObjectAbstract () |
Static Public Member Functions inherited from BxDolTranscoder | |
static | getObjectInstance ($sObject) |
static | pruning () |
static | processQueue ($bQueuePruning=true) |
static | pruneQueue () |
static | processCompleted () |
static | registerHandlersArray ($mixed) |
static | registerHandlersSystem () |
static | unregisterHandlersArray ($mixed) |
static | cleanupObjectsArray ($mixed) |
static | onAlertResponseFileDeleteLocal ($oAlert, $sObject) |
static | onAlertResponseFileDeleteOrig ($oAlert, $sObject) |
Protected Member Functions | |
__construct ($aObject, $oStorage) | |
getCustomResizeDimension ($sName) | |
applyFilter_Grayscale ($sFile, $aParams) | |
applyFilter_ResizeVar ($sFile, $aParams) | |
Protected Member Functions inherited from BxDolTranscoder | |
storeTranscodedFileInQueueStorage ($mixedHandler, $sTmpFile, &$sFileUrlResult) | |
addToQueue ($mixedHandler, $iProfileId=0) | |
applyFilter_Resize ($sFile, $aParams) | |
isFileReady_Folder ($mixedHandlerOrig, $isCheckOutdated=true) | |
isFileReady_Storage ($mixedHandlerOrig, $isCheckOutdated=true) | |
isPrivate_Folder ($mixedHandler) | |
isPrivate_Storage ($mixedHandler) | |
getFilePath_Folder ($mixedHandler) | |
storeFileLocally_Folder ($mixedHandler) | |
storeFileLocally_Storage ($mixedHandler) | |
storeFileLocally_Queue ($mixedHandler) | |
getOrigFileUrl_Folder ($mixedHandler) | |
getOrigFileUrl_Storage ($mixedHandler) | |
initFilters () | |
clearCacheDB () | |
processHandlerForRetinaDevice ($mixedHandler) | |
Additional Inherited Members | |
Static Protected Member Functions inherited from BxDolTranscoder | |
static | getTranscoderObjects () |
static | _callFuncForObjectsArray ($mixed, $sFunc) |
Protected Attributes inherited from BxDolTranscoder | |
$_sLog = '' | |
$_aObject | |
$_oStorage | |
$_oDb | |
$_sRetinaSuffix = '@2x' | |
$_sQueueTable = '' | |
$_sQueueStorage = '' | |
$_iDevicePixelRatio = false | |
This class transcodes images on the fly. Transcoded image is saved in the specified storage engine and next time ready image is served.
To add image transcoder object add record to 'sys_objects_transcoder' table:
Then you need to add image filters to 'sys_transcoder_filters' table:
'Folder' source types: This source type is some folder with original images for the transcoding, the identifier of the image (handler) is file name. The params are the following:
'Storage' source type: The source of original files is Storage engine, the identifier of the image (handler) is file id. The params are the following:
Available filters:
Automatic deletetion of associated data is supported - in the case if original or transcoded file is deleted, but you need to register alert handlers, just call registerHandlers () function to register handler (for example, during module installation) and call unregisterHandlers () function to unregister handlers (for example, during module uninstallation)
Example of usage:
|
protected |
constructor
Reimplemented from BxDolTranscoder.
BxDolTranscoderImage::getFileUrl | ( | $mixedHandler | ) |
Get transcoded file url. If transcoded file is ready then direct url to the file is returned. If there is no transcoded data available, then special url is returned, upon opening this url image is transcoded automatically and redirects to the ready transcoed image.
$mixedHandler | - file handler |
Reimplemented from BxDolTranscoder.
BxDolTranscoderImage::getFileUrlNotReady | ( | $mixedHandler | ) |
Get file url when file isn't transcoded yet
Reimplemented from BxDolTranscoder.
BxDolTranscoderImage::isFileReady | ( | $mixedHandler, | |
$isCheckOutdated = true ) |
Check if transcoded data is available. No need to call it directly, it is called automatically when it is needed.
$mixedHandler | - file handler |
$isCheckOutdated | - check if transcoded file is outdated |
Reimplemented from BxDolTranscoder.
BxDolTranscoderImage::isMimeTypeSupported | ( | $sMimeType | ) |
check if transcoder suppors given file mime type
Reimplemented from BxDolTranscoder.
BxDolTranscoderImage::transcode | ( | $mixedHandler, | |
$iProfileId = 0 ) |
Transcode file, no need to call it directly, it is called automatically when it is needed.
$mixedHandler | - file handler |
$iProfileId | - optional profile id, to assign transcoded file ownership to, usually it is NOT assigned to any particular profile, so just leave it default |
system
transcode
false
transcoder_object
- [array] transcoder object propertiesobject
- [object] transcoder objectdb
- [object] database objectfile_path
- [string] file pathret
- [bool] by ref, not used
system
transcoded
false
object
- [object] transcoder objectret
- [bool] by ref, override return value
Reimplemented from BxDolTranscoder.