1: <?php
2: 3: 4: 5: 6: 7: 8:
9: class Ansel_ImageGenerator_RoundedThumbStack extends Ansel_ImageGenerator
10: {
11: public $need = array('PhotoStack');
12:
13: 14: 15: 16:
17: protected function _create()
18: {
19: $imgobjs = $this->_getStackImages();
20: $style = $this->_params['style'];
21: $params = array('width' => 100,
22: 'height' => 100,
23: 'background' => $style->background);
24:
25: $baseImg = Ansel::getImageObject($params);
26:
27: try {
28: $baseImg->addEffect(
29: 'PhotoStack',
30: array('images' => $imgobjs,
31: 'resize_height' => $GLOBALS['conf']['thumbnail']['height'],
32: 'padding' => 0,
33: 'background' => $style->background,
34: 'type' => 'rounded'));
35:
36: $baseImg->applyEffects();
37: $baseImg->resize($GLOBALS['conf']['thumbnail']['width'],
38: $GLOBALS['conf']['thumbnail']['height']);
39: } catch (Horde_Image_Exception $e) {
40: throw new Ansel_Exception($e);
41: }
42:
43: return $baseImg;
44: }
45:
46: }
47: