1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13: class Ansel_ImageGenerator_Mini extends Ansel_ImageGenerator
14: {
15: 16: 17: 18:
19: protected function _create()
20: {
21: if ($GLOBALS['conf']['image']['squaremini']) {
22: $generator = Ansel_ImageGenerator::factory('SquareThumb', array('width' => min(50, $this->_dimensions['width']),
23: 'height' => min(50, $this->_dimensions['height']),
24: 'image' => $this->_image,
25: 'style' => $this->_params['style']));
26: return $generator->create();
27: } else {
28: $this->_image->resize(min(50, $this->_dimensions['width']),
29: min(50, $this->_dimensions['height']),
30: true);
31: if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
32: try {
33: $this->_image->addEffect('Unsharpmask',
34: array('radius' => $GLOBALS['conf']['thumbnail']['radius'],
35: 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'],
36: 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
37: $this->_image->applyEffects();
38: } catch (Horde_Image_Exception $e) {
39: throw new Ansel_Exception($e);
40: }
41: }
42:
43: return $this->_image->getHordeImage();
44: }
45: }
46:
47: }
48: