/**
* {@inheritdoc}
*/
protected function executeResize(ImageInterface $image, ResizeCoordinatesInterface $coordinates, $path, ResizeOptionsInterface $options)
{
if (isset($GLOBALS['TL_HOOKS']['getImage']) && is_array($GLOBALS['TL_HOOKS']['getImage']) && $this->legacyImage) {
foreach ($GLOBALS['TL_HOOKS']['getImage'] as $callback) {
$return = System::importStatic($callback[0])->{$callback[1]}($this->legacyImage->getOriginalPath(), $this->legacyImage->getTargetWidth(), $this->legacyImage->getTargetHeight(), $this->legacyImage->getResizeMode(), $this->legacyImage->getCacheName(), new File($this->legacyImage->getOriginalPath()), $this->legacyImage->getTargetPath(), $this->legacyImage);
if (is_string($return)) {
return $this->createImage($image, TL_ROOT . '/' . $return);
}
}
}
if ($image->getImagine() instanceof GdImagine) {
/** @var Config $config */
$config = $this->framework->getAdapter(Config::class);
$dimensions = $image->getDimensions();
// Return the path to the original image if it cannot be handled
if ($dimensions->getSize()->getWidth() > $config->get('gdMaxImgWidth') || $dimensions->getSize()->getHeight() > $config->get('gdMaxImgHeight') || $coordinates->getSize()->getWidth() > $config->get('gdMaxImgWidth') || $coordinates->getSize()->getHeight() > $config->get('gdMaxImgHeight')) {
return $this->createImage($image, $image->getPath());
}
}
return parent::executeResize($image, $coordinates, $path, $options);
}