public static function get($image, $width, $height, $mode = '', $target = null, $force = false)
{
@trigger_error('Using Image::get() has been deprecated and will no longer work in Contao 5.0. Use the contao.image.image_factory service instead.', E_USER_DEPRECATED);
if ($image == '') {
return null;
}
try {
$imageObj = static::create($image, array($width, $height, $mode));
$imageObj->setTargetPath($target);
$imageObj->setForceOverride($force);
if (($path = $imageObj->executeResize()->getResizedPath()) != '') {
return $path;
}
} catch (\Exception $e) {
\System::log('Image "' . $image . '" could not be processed: ' . $e->getMessage(), __METHOD__, TL_ERROR);
}
return null;
}