public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     $width = $imagick->getImageWidth();
     $height = $imagick->getImageHeight();
     $this->height = $height * $this->percentHeight;
     $this->width = $width * $this->percentWidth;
     parent::modify($image);
 }
示例#2
0
 public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     if ($this->vertical) {
         $imagick->flipImage();
     }
     if ($this->horizontal) {
         $imagick->flopImage();
     }
 }
示例#3
0
 public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     /* Black text */
     $this->draw->setFillColor($this->color);
     /* Font properties */
     $this->draw->setFont($this->font);
     $this->draw->setFillOpacity($this->opacity);
     $this->draw->setFontSize($this->size);
     $this->draw->setTextAlignment($this->alignment);
     /* Create text */
     $imagick->annotateImage($this->draw, $this->x, $this->y, 0, $this->text);
 }
示例#4
0
 public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     $width = $imagick->getImageWidth();
     $height = $imagick->getImageHeight();
     //Figure out filter depending if shrinking or enlarging image
     $filter = $this->filter;
     if ($filter == null) {
         //Default to LANCZOS
         $filter = self::FILTER_LANCZOS;
         if ($width < $this->width && $height < $this->height) {
             //Enlarging image, use Mitchell
             $filter = self::FILTER_MITCHELL;
         }
     }
     $imagick->resizeImage($this->width, $this->height, $filter, 1);
 }
示例#5
0
 public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     $width = $imagick->getImageWidth();
     $height = $imagick->getImageHeight();
     $widthRatio = $this->maxWidth / $width;
     $heightRatio = $this->maxHeight / $height;
     if ($widthRatio < $heightRatio) {
         //Scale by width
         $this->height = $widthRatio * $height;
         $this->width = $this->maxWidth;
         parent::modify($image);
     } else {
         //Scale by height
         $this->width = $heightRatio * $width;
         $this->height = $this->maxHeight;
         parent::modify($image);
     }
 }
示例#6
0
 public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     $imagick->setImageOpacity($this->opacity);
 }
示例#7
0
 public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     $imagick->compositeImage($this->image->getImagick(), Imagick::COMPOSITE_DEFAULT, $this->x, $this->y);
 }
 public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     $imagick->gaussianBlurImage($this->radius, $this->sigma, $this->channel);
 }
示例#9
0
 public function modify(Image $image)
 {
     $imagick = $image->getImagick();
     $imagick->cropImage($this->width, $this->height, $this->x, $this->y);
 }