ImageManipulatorGd
in package
implements
ImageManipulator
Manipulates images using gd library.
Tags
Interfaces, Classes, Traits and Enums
- ImageManipulator
- Modifies images.
Table of Contents
- $image : resource
- Image
- $type : int
- GD image type
- __construct() : mixed
- Constructor.
- __destruct() : mixed
- Destructor
- convertToJpeg() : mixed
- Converts the image to JPEG format.
- crop() : mixed
- Crops the image.
- getHeight() : int
- Returns the height of the image.
- getImageData() : string
- Returns the image as binary string.
- getWidth() : int
- Returns the width of the image.
- thumbnail() : mixed
- Resizes the image to the given maximum dimensions.
Properties
$image
Image
private
resource
$image
image
$type
GD image type
private
int
$type
image type
Methods
__construct()
Constructor.
public
__construct(string $imageData) : mixed
Parameters
- $imageData : string
-
original image as binary string
Return values
mixed —__destruct()
Destructor
public
__destruct() : mixed
Return values
mixed —convertToJpeg()
Converts the image to JPEG format.
public
convertToJpeg() : mixed
Tags
Return values
mixed —crop()
Crops the image.
public
crop(mixed $x, mixed $y, mixed $width, mixed $height) : mixed
Parameters
- $x : mixed
-
starting point in original image
- $y : mixed
-
starting point in original image
- $width : mixed
-
width of target size
- $height : mixed
-
height of target size
Tags
Return values
mixed —getHeight()
Returns the height of the image.
public
getHeight() : int
Tags
Return values
int —height
getImageData()
Returns the image as binary string.
public
getImageData() : string
Tags
Return values
string —image data
getWidth()
Returns the width of the image.
public
getWidth() : int
Tags
Return values
int —width
thumbnail()
Resizes the image to the given maximum dimensions.
public
thumbnail(mixed $width, mixed $height) : mixed
Parameters
- $width : mixed
-
width
- $height : mixed
-
height