Contao\CoreBundle\Test\Contao\ImageTest::getImageHookCallback PHP Method

getImageHookCallback() public static method

Returns a custom image path.
public static getImageHookCallback ( string $originalPath, integer $targetWidth, integer $targetHeight, string $resizeMode, string $cacheName, object $fileObj, string $targetPath, object $imageObj ) : string
$originalPath string
$targetWidth integer
$targetHeight integer
$resizeMode string
$cacheName string
$fileObj object
$targetPath string
$imageObj object
return string
    public static function getImageHookCallback($originalPath, $targetWidth, $targetHeight, $resizeMode, $cacheName, $fileObj, $targetPath, $imageObj)
    {
        // Do not include $cacheName as it is dynamic (mtime)
        $path = 'assets/' . $originalPath . '&getImage' . '_' . $targetWidth . '_' . $targetHeight . '_' . $resizeMode . '_' . str_replace('\\', '-', get_class($fileObj)) . '_' . $targetPath . '_' . str_replace('\\', '-', get_class($imageObj)) . '.jpg';
        file_put_contents(TL_ROOT . '/' . $path, '');
        return $path;
    }