1: <?php
2: 3: 4: 5: 6: 7:
8: class Ansel_ImageGenerator_Thumb extends Ansel_ImageGenerator
9: {
10: public function __construct($params)
11: {
12: parent::__construct($params);
13: $this->title = _("Basic Thumbnails");
14: }
15:
16: 17: 18: 19:
20: protected function _create()
21: {
22: $this->_image->resize(min($GLOBALS['conf']['thumbnail']['width'], $this->_dimensions['width']),
23: min($GLOBALS['conf']['thumbnail']['height'], $this->_dimensions['height']),
24: true);
25: if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
26: try {
27: $this->_image->addEffect('Unsharpmask',
28: array('radius' => $GLOBALS['conf']['thumbnail']['radius'],
29: 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'],
30: 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
31: $this->_image->applyEffects();
32: } catch (Horde_Image_Exception $e) {
33: throw new Ansel_Exception($e);
34: }
35: }
36:
37: return $this->_image->getHordeImage();
38: }
39:
40: }
41: