rotate()
| Returns: | TRUE on success, FALSE on failure |
|---|---|
| Return type: | bool |
The image rotation method requires that the angle of rotation be set via its preference:
$config['rotation_angle'] = '90';
There are 5 rotation options:
- 90 - rotates counter-clockwise by 90 degrees.
- 180 - rotates counter-clockwise by 180 degrees.
- 270 - rotates counter-clockwise by 270 degrees.
- hor - flips the image horizontally.
- vrt - flips the image vertically.
Here’s an example showing how you might rotate an image:
$config['image_library'] = 'netpbm';
$config['library_path'] = '/usr/bin/';
$config['source_image'] = '/path/to/image/mypic.jpg';
$config['rotation_angle'] = 'hor';
$this->image_lib->initialize($config);
if ( ! $this->image_lib->rotate())
{
echo $this->image_lib->display_errors();
}
Please login to continue.