Beispiel #1
0
 /**
  * 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
  */
 function generateThumbName($name, $params)
 {
     if (!$this->getHandler()) {
         return null;
     }
     $extension = $this->getExtension();
     list($thumbExt, $thumbMime) = $this->handler->getThumbType($extension, $this->getMimeType(), $params);
     $thumbName = $this->handler->makeParamString($params) . '-' . $name;
     if ($thumbExt != $extension) {
         $thumbName .= ".{$thumbExt}";
     }
     return $thumbName;
 }
Beispiel #2
0
 public function generateThumbName($name, $params, $clientParams = array())
 {
     if (!$this->getHandler()) {
         return null;
     }
     $extension = $this->getExtension();
     list($thumbExt, ) = $this->handler->getThumbType($extension, $this->getMimeType(), $params);
     $thumbName = $this->handler->makeParamString($params) . '-' . $name;
     // hook to change the file name based on params (like crop or watermark for example)
     wfRunHooks("FileThumbName", array($this, $clientParams, $params, &$thumbName));
     if ($thumbExt != $extension) {
         $thumbName .= ".{$thumbExt}";
     }
     return $thumbName;
 }