Returns a path to a given thumbnail or an thumbnail configuration.
public getThumbnail ( null $config = null, boolean $deferred = true ) : |
||
$config | null | |
$deferred | boolean | |
Résultat |
/** * @param $conf * @return Asset\Image\Thumbnail|string */ public function getThumbnail($conf) { if ($this->image instanceof Asset) { $thumbConfig = $this->image->getThumbnailConfig($conf); if ($thumbConfig && $this->cropPercent) { $thumbConfig->addItemAt(0, "cropPercent", array("width" => $this->cropWidth, "height" => $this->cropHeight, "y" => $this->cropTop, "x" => $this->cropLeft)); $hash = md5(Serialize::serialize($thumbConfig->getItems())); $thumbConfig->setName($thumbConfig->getName() . "_auto_" . $hash); } return $this->image->getThumbnail($thumbConfig); } return ""; }