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