示例#1
0
 public function asidoResizeImg($args = array(), $crop = false)
 {
     asido::driver('gd');
     $source_image = $args["source_image"];
     $target_image = $args["target_image"];
     $width = $args["width"];
     $height = $args["height"];
     // process crop images
     $i1 = asido::image($source_image, $target_image);
     // fit and add white frame
     if ($crop) {
         $x = $args["x"];
         $y = $args["y"];
         Asido::crop($i1, $x, $y, $width, $height);
     } else {
         Asido::frame($i1, $width, $height, Asido::Color(255, 255, 255));
     }
     $i1->Save(ASIDO_OVERWRITE_ENABLED);
 }
示例#2
0
 /**
  * Resize an image to fit a frame
  *
  * @since	1.0
  * @access	public
  * @param	int			The target width.
  * @param	int			The target height.
  * @return	SocialImage	Returns itself for chaining.
  */
 public function frame($width = null, $height = null)
 {
     $this->adapter->frame($this->image, $width, $height);
     return $this;
 }