本文整理匯總了PHP中Intervention\Image\Image::flip方法的典型用法代碼示例。如果您正苦於以下問題:PHP Image::flip方法的具體用法?PHP Image::flip怎麽用?PHP Image::flip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Intervention\Image\Image
的用法示例。
在下文中一共展示了Image::flip方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* Correct image orientation according to Exif data
*
* @param \Intervention\Image\Image $image
* @return boolean
*/
public function execute($image)
{
switch ($image->exif('Orientation')) {
case 2:
$image->flip();
break;
case 3:
$image->rotate(180);
break;
case 4:
$image->rotate(180)->flip();
break;
case 5:
$image->rotate(270)->flip();
break;
case 6:
$image->rotate(270);
break;
case 7:
$image->rotate(90)->flip();
break;
case 8:
$image->rotate(90);
break;
}
return true;
}
示例2: applyFilter
/**
* Applies filter effects to the given image
*
* @param Image\Image $image The image to filter.
*
* @return Image\Image The filtered image.
*
* @throws FilterException if an invalid mode has been given.
*/
public function applyFilter(Image\Image $image)
{
switch ($this->mode) {
case self::FLIP_HORIZONTAL:
return $image->flip('h');
case self::FLIP_VERTICAL:
return $image->flip('v');
case self::ROTATE_LEFT:
return $image->rotate(90);
case self::ROTATE_RIGHT:
return $image->rotate(-90);
default:
throw new FilterException('De bewerking die u gekozen heeft bestaat niet.', 1);
}
}
示例3: rotation
protected function rotation()
{
// Auto orientate
$this->image->orientate();
if ($this->flip) {
$this->image->flip($this->flip);
}
// Rotate within the existing frame
if ($this->rotation) {
$width = $this->image->getWidth();
$height = $this->image->getHeight();
$this->image->rotate($this->rotation);
$this->image->crop($width, $height);
}
// Rotate entire image
if ($this->orientation) {
$this->image->rotate($this->orientation);
}
}
示例4: handle
/**
* Handle the image manipulation request
* @param \Intervention\Image\Image $image
* @param array $options
* @return \Intervention\Image\Image
*/
public function handle($image, $options)
{
$options = array_merge($this->defaults, $options);
return $image->flip($options['mode']);
}
示例5: flip
/**
* Mirror image horizontally or vertically
*
* @param mixed $mode
* @return \Intervention\Image\Image
* @static
*/
public static function flip($mode = null)
{
return \Intervention\Image\Image::flip($mode);
}