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