/** * (non-PHPdoc) * @see \Simplify\Thumb\Plugin::process() */ protected function process(\Simplify\Thumb\Processor $thumb, $filter = null) { \Simplify\Thumb\Functions::validateImageResource($thumb->image); $args = func_get_args(); $args[0] = $thumb->image; call_user_func_array('imagefilter', $args); }
/** * (non-PHPdoc) * @see \Simplify\Thumb\Plugin::process() */ protected function process(\Simplify\Thumb\Processor $thumb, $overlayImage = null, $dst_x = 0, $dst_y = 0, $src_x = 0, $src_y = 0, $src_w = null, $src_h = null, $pct = 0) { $overlay = \Simplify\Thumb\Functions::load($overlayImage); $src_w = is_null($src_w) ? imagesx($overlay) : $src_w; $src_h = is_null($src_h) ? imagesy($overlay) : $src_h; imagecopymerge($thumb->image, $overlay, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct); }
/** * (non-PHPdoc) * @see \Simplify\Thumb\Plugin::process() */ protected function process(\Simplify\Thumb\Processor $thumb, $overlayImage = null, $dst_x = 0, $dst_y = 0, $src_x = 0, $src_y = 0, $dst_w = null, $dst_h = null, $src_w = null, $src_h = null) { $overlay = \Simplify\Thumb\Functions::load($overlayImage); $dst_w = is_null($dst_w) ? imagesx($overlay) : $dst_w; $dst_h = is_null($dst_h) ? imagesy($overlay) : $dst_h; $src_w = is_null($src_w) ? imagesx($overlay) : $src_w; $src_h = is_null($src_h) ? imagesy($overlay) : $src_h; imagealphablending($thumb->image, true); imagecopyresampled($thumb->image, $overlay, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); }
/** * (non-PHPdoc) * @see \Simplify\Thumb\Plugin::process() */ protected function process(\Simplify\Thumb\Processor $thumb, $top = null, $right = null, $bottom = null, $left = null, $r = 0, $g = 0, $b = 0, $a = 0) { $thumb->image = \Simplify\Thumb\Functions::offset($thumb->image, $top, $right, $bottom, $left, $r, $g, $b, $a); }
/** * (non-PHPdoc) * @see Simplify_Thumb_Plugin::process() */ protected function process(\Simplify\Thumb\Processor $thumb, $x = null, $y = null, $width = null, $height = null, $r = 0, $g = 0, $b = 0, $a = 0) { $thumb->image = \Simplify\Thumb\Functions::crop($thumb->image, $x, $y, $width, $height, $r, $g, $b, $a); }
/** * Save file * * @param string $file * @param string $type */ public function save($file, $type = null) { $image = $this->image; if (empty($type)) { $type = $this->originalType; } \Simplify\Thumb\Functions::validateImageResource($image); if (empty($type)) { $type = IMAGETYPE_JPEG; } if (!is_dir(dirname($file))) { if (!mkdir(dirname($file))) { throw new \Simplify\ThumbException('Could not create thumb save dir: ' . dirname($file)); } } switch ($type) { case IMAGETYPE_JPEG: imagejpeg($image, $file, $this->quality); break; case IMAGETYPE_GIF: imagesavealpha($image, true); imagegif($image, $file); break; case IMAGETYPE_PNG: imagesavealpha($image, true); imagepng($image, $file); break; } }
/** * (non-PHPdoc) * @see \Simplify\Thumb\Plugin::process() */ protected function process(\Simplify\Thumb\Processor $thumb, $width = null, $height = null, $gravity = \Simplify\Thumb::CENTER) { $thumb->image = \Simplify\Thumb\Functions::zoomCrop($thumb->image, $width, $height, $gravity); }
/** * (non-PHPdoc) * @see \Simplify\Thumb\Plugin::process() */ protected function process(\Simplify\Thumb\Processor $thumb, $width = null, $height = null, $mode = \Simplify\Thumb::FIT_INSIDE, $far = false, $r = 0, $g = 0, $b = 0, $a = 0) { $thumb->image = \Simplify\Thumb\Functions::resize($thumb->image, $width, $height, $mode, $far, $r, $g, $b, $a); }