예제 #1
0
 /**
  * Apply the transformation to the image and returns the image thumbnail
  */
 protected function transform(sfImage $image)
 {
     // Work out where we need to draw to
     $offset = $this->getThickness() / 2;
     $mod = $this->getThickness() % 2;
     $x2 = $image->getWidth() - $offset - ($mod === 0 ? 1 : 0);
     $y2 = $image->getHeight() - $offset - ($mod === 0 ? 1 : 0);
     $image->rectangle($offset, $offset, $x2, $y2, $this->getThickness(), $this->getColor());
     return $image;
 }