本文整理汇总了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);
}