Contao\CoreBundle\Test\Image\ImageFactoryTest::executeResizeHookCallback PHP Method

executeResizeHookCallback() public static method

Returns a custom image path.
public static executeResizeHookCallback ( object $imageObj ) : string
$imageObj object The image object
return string The image path
    public static function executeResizeHookCallback($imageObj)
    {
        // Do not include $cacheName as it is dynamic (mtime)
        $path = 'assets/' . $imageObj->getOriginalPath() . '&executeResize' . '_' . $imageObj->getTargetWidth() . '_' . $imageObj->getTargetHeight() . '_' . $imageObj->getResizeMode() . '_' . $imageObj->getTargetPath() . '_' . str_replace('\\', '-', get_class($imageObj)) . '.jpg';
        if (!file_exists(dirname(TL_ROOT . '/' . $path))) {
            mkdir(dirname(TL_ROOT . '/' . $path), 0777, true);
        }
        file_put_contents(TL_ROOT . '/' . $path, '');
        return $path;
    }