/** * Create a new thumbnail for the image object * * This uses this Images' key to determine the Imagetype and its * default thumbnail size. * @return boolean True on success, false otherwise. * @author Reto Kohli <*****@*****.**> */ function makeThumbnail() { global $objDatabase; if (!$this->id) { return false; } // Only try to create thumbs from entries that contain a // file name with a known extension if ($this->path == '' || !preg_match('/\\.(?:jpe?g|gif|png)$/i', $this->path)) { return false; } // Get the thumbnail size for the associated type $arrOptions = \Cx\Core\ImageType\Controller\ImageType::getThumbnailOptions($this->imagetype_key); return self::createThumbnail($this->path, $arrOptions['width'], $arrOptions['height'], $arrOptions['quality']); }