/** * Generate a thumbnail file name from a name and specified parameters * * @param string $name * @param array $params Parameters which will be passed to MediaHandler::makeParamString * @return string|null */ public function generateThumbName($name, $params) { if (!$this->getHandler()) { return null; } $extension = $this->getExtension(); list($thumbExt, ) = $this->getHandler()->getThumbType($extension, $this->getMimeType(), $params); $thumbName = $this->getHandler()->makeParamString($params); if ($this->repo->supportsSha1URLs()) { $thumbName .= '-' . $this->getSha1() . '.' . $thumbExt; } else { $thumbName .= '-' . $name; if ($thumbExt != $extension) { $thumbName .= ".{$thumbExt}"; } } return $thumbName; }