3 use WebThumbnailer\WebThumbnailer
;
8 * Utility class used to retrieve thumbnails using web-thumbnailer dependency.
13 * @var WebThumbnailer instance.
18 * @var ConfigManager instance.
23 * Thumbnailer constructor.
25 * @param ConfigManager $conf instance.
27 public function __construct($conf)
30 $this->wt
= new WebThumbnailer();
31 \WebThumbnailer\Application\ConfigManager
::addFile('inc/web-thumbnailer.json');
32 $this->wt
->maxWidth($this->conf
->get('thumbnails.width'))
33 ->maxHeight($this->conf
->get('thumbnails.height'))
35 ->debug($this->conf
->get('dev.debug', false));
39 * Retrieve a thumbnail for given URL
41 * @param string $url where to look for a thumbnail.
43 * @return bool|string The thumbnail relative cache file path, or false if none has been found.
45 public function get($url)
47 return $this->wt
->thumbnail($url);