Interface ImageHandlerInterface

Summary

Fully Qualified Name: CodeIgniter\Images\ImageHandlerInterface

Description

Expected behavior of an Image handler

Methods

Name Description Defined By
convert() Changes the stored image type to indicate the new file format to use when saving. ImageHandlerInterface
crop() Crops the image to the desired height and width. If one of the height/width values is not provided, that value will be set the appropriate value based on offsets and image dimensions. ImageHandlerInterface
fit() Combine cropping and resizing into a single command. ImageHandlerInterface
flatten() Flattens transparencies, default white background ImageHandlerInterface
flip() Flip an image horizontally or vertically ImageHandlerInterface
getEXIF() Retrieve the EXIF information from the image, if possible. Returns an array of the information, or null if nothing can be found. ImageHandlerInterface
reorient() Reads the EXIF information from the image and modifies the orientation so that displays correctly in the browser. ImageHandlerInterface
resize() Resize the image ImageHandlerInterface
rotate() Rotates the image on the current canvas. ImageHandlerInterface
save() Saves any changes that have been made to file. ImageHandlerInterface
text() Overlays a string of text over the image. ImageHandlerInterface

Method Details

convert()

Changes the stored image type to indicate the new file format to use when saving.

Does not touch the actual resource.

Parameter Name Type Description
$imageType int|null A

Returns: $this

crop()

Crops the image to the desired height and width. If one of the height/width values is not provided, that value will be set the appropriate value based on offsets and image dimensions.

Parameter Name Type Description
$width int|null
$height int|null
$x int|null X-axis
$y int|null Y-axis
$maintainRatio bool
$masterDim string

Returns: mixed

fit()

Combine cropping and resizing into a single command.

Supported positions:

Parameter Name Type Description
$width int
$height int
$position string

Returns: bool

flatten()

Flattens transparencies, default white background

Parameter Name Type Description
$red int
$green int
$blue int

Returns: mixed

flip()

Flip an image horizontally or vertically

Parameter Name Type Description
$dir string Direction

Returns: mixed

getEXIF()

Retrieve the EXIF information from the image, if possible. Returns an array of the information, or null if nothing can be found.

Parameter Name Type Description
$key string|null If

Returns: mixed

reorient()

Reads the EXIF information from the image and modifies the orientation so that displays correctly in the browser.

Returns: \ImageHandlerInterface

resize()

Resize the image

Parameter Name Type Description
$width int
$height int
$maintainRatio bool If
$masterDim string

Returns:

rotate()

Rotates the image on the current canvas.

Parameter Name Type Description
$angle float

Returns: mixed

save()

Saves any changes that have been made to file.

Example: $image->resize(100, 200, true)

  ->save($target);
Parameter Name Type Description
$target string
$quality int

Returns: mixed

text()

Overlays a string of text over the image.

Valid options:

Parameter Name Type Description
$text string
$options array

Returns: $this

Top