method rotate documentation in bbn\File\Image

Rotates the image.

Example

$img = new bbn\File\Image("/home/data/test/image.jpg"); $img->rotate( 90 )->save(); function($angle) { $ok = false; if ($this->test()) { if (self::isImagick()) { if ($this->img->rotateImage(new \ImagickPixel(),$angle)) { $ok = 1; } } elseif (function_exists('imagerotate')) { if ($this->img = imagerotate($this->img, $angle, 0)) { if ($this->ext == 'png' || $this->ext == 'gif' || $this->ext == 'svg') { imagecolorallocatealpha($this->img, 0, 0, 0, 127); imagealphablending($this->img, false); imagesavealpha($this->img, true); } $ok = 1; } } if ($ok) { if ($angle == 90 || $angle == 270) { $h = $this->h; $this->h = $this->w; $this->w = $h; } } else{ $this->error = X::_("There has been a problem"); } } return $this; }

Rotates the image. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.