1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10: class Horde_Image_Effect_Im_RoundCorners extends Horde_Image_Effect
11: {
12: 13: 14: 15: 16: 17: 18:
19: protected $_params = array('radius' => 10,
20: 'background' => 'none',
21: 'border' => 0,
22: 'bordercolor' => 'none');
23:
24: public function apply()
25: {
26:
27: $round = $this->_params['radius'];
28:
29:
30: $dimensions = $this->_image->getDimensions();
31: $height = $dimensions['height'];
32: $width = $dimensions['width'];
33:
34: $this->_image->addOperation("-size {$width}x{$height} xc:{$this->_params['background']} "
35: . "-fill {$this->_params['background']} -draw \"matte 0,0 reset\" -tile");
36:
37: $this->_image->roundedRectangle(round($round / 2),
38: round($round / 2),
39: $width - round($round / 2) - 2,
40: $height - round($round / 2) - 2,
41: $round + 2,
42: 'none',
43: 'white');
44:
45:
46: $this->_image->clearGeometry();
47:
48: return true;
49: }
50:
51: }