public getCacheName ( ) : string | ||
return | string | The cache name |
public function getCacheName()
{
$importantPart = $this->getImportantPart();
$strCacheKey = substr(md5('-w' . $this->getTargetWidth() . '-h' . $this->getTargetHeight() . '-o' . $this->getOriginalPath() . '-m' . $this->getResizeMode() . '-z' . $this->getZoomLevel() . '-x' . $importantPart['x'] . '-y' . $importantPart['y'] . '-i' . $importantPart['width'] . '-e' . $importantPart['height'] . '-t' . $this->fileObj->mtime), 0, 8);
return System::getContainer()->getParameter('contao.image.target_path') . '/' . substr($strCacheKey, -1) . '/' . $this->fileObj->filename . '-' . $strCacheKey . '.' . $this->fileObj->extension;
}
/** * {@inheritdoc} */ public function getCacheName() { $strFallbackFormat = \Config::get('magickimages_fallback_extension') ?: 'jpg'; if (!in_array($this->fileObj->extension, ['jpg', 'png', 'gif'])) { // Change file suffix return substr(parent::getCacheName(), 0, -strlen($this->fileObj->extension)) . $strFallbackFormat; } return parent::getCacheName(); }