function ImageToolkitInterface::rotate

Rotates an image the given number of degrees.

Parameters

object $image: An image object. The $image->resource, $image->info['width'], and $image->info['height'] values will be modified by this call.

int $degrees: The number of (clockwise) degrees to rotate the image.

string $background: (optional) An hexadecimal integer specifying the background color to use for the uncovered area of the image after the rotation. E.g. 0x000000 for black, 0xff00ff for magenta, and 0xffffff for white. For images that support transparency, this will default to transparent. Otherwise it will be white.

Return value

bool TRUE or FALSE, based on success.

See also

image_rotate()

2 methods override ImageToolkitInterface::rotate()
GDToolkit::rotate in drupal/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
Implements \Drupal\system\Plugin\ImageToolkitInterface::rotate().
TestToolkit::rotate in drupal/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php
Implements \Drupal\system\Plugin\ImageToolkitInterface::rotate().

File

drupal/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitInterface.php, line 70
Contains \Drupal\system\Plugin\ImageToolkitInterface.

Class

ImageToolkitInterface
Defines an interface for image toolkits.

Namespace

Drupal\system\Plugin

Code

function rotate($image, $degrees, $background = NULL);