HumHub Documentation (unofficial)

Transformation
in package
implements FilterInterface, ManipulatorInterface

FinalYes

A transformation filter.

Table of Contents

Interfaces

FilterInterface
Interface for imagine filters.
ManipulatorInterface
The manipulator interface.

Properties

$filters  : mixed
$imagine  : ImageInterface|null
An ImagineInterface instance.
$sorted  : mixed|null

Methods

__construct()  : mixed
Class constructor.
add()  : $this
Registers a given FilterInterface in an internal array of filters for later application to an instance of ImageInterface.
apply()  : ImageInterface
Applies scheduled transformation to an ImageInterface instance.
applyFilter()  : ImageInterface
Applies a given FilterInterface onto given ImageInterface and returns modified ImageInterface.
applyMask()  : $this
Applies a given mask to current image's alpha channel.
copy()  : static
Copies current source image into a new ImageInterface instance.
crop()  : $this
Crops a specified box out of the source image (modifies the source image) Returns cropped self.
fill()  : $this
Fills image with provided filling, by replacing each pixel's color in the current image with corresponding color from FillInterface, and returns modified image.
flipHorizontally()  : $this
Flips current image using vertical axis.
flipVertically()  : $this
Flips current image using horizontal axis.
getFilters()  : array<string|int, mixed>
Returns a list of filters sorted by their priority. Filters with same priority will be returned in the order they were added.
paste()  : $this
Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails.
resize()  : $this
Resizes current image and returns self.
rotate()  : $this
Rotates an image at the given angle.
save()  : $this
Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp, xbm, webp and bmp are supported.
show()  : $this
Outputs the image content.
strip()  : $this
Remove all profiles and comments.
thumbnail()  : static
Generates a thumbnail from a current image Returns it as a new image without modifying the current image unless the THUMBNAIL_FLAG_NOCLONE flag is specified.

Properties

Methods

add()

Registers a given FilterInterface in an internal array of filters for later application to an instance of ImageInterface.

public add(FilterInterface $filter[, int $priority = 0 ]) : $this
Parameters
$filter : FilterInterface
$priority : int = 0
Return values
$this

getFilters()

Returns a list of filters sorted by their priority. Filters with same priority will be returned in the order they were added.

public getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>

save()

Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp, xbm, webp and bmp are supported.

public save([mixed $path = null ][, array<string|int, mixed> $options = array() ]) : $this
Parameters
$path : mixed = null
$options : array<string|int, mixed> = array()
Tags
see
ManipulatorInterface::save()
Return values
$this

show()

Outputs the image content.

public show(mixed $format[, array<string|int, mixed> $options = array() ]) : $this
Parameters
$format : mixed
$options : array<string|int, mixed> = array()
Tags
see
ManipulatorInterface::show()
Return values
$this

thumbnail()

Generates a thumbnail from a current image Returns it as a new image without modifying the current image unless the THUMBNAIL_FLAG_NOCLONE flag is specified.

public thumbnail(BoxInterface $size[, mixed $settings = ImageInterface::THUMBNAIL_INSET ][, mixed $filter = ImageInterface::FILTER_UNDEFINED ]) : static
Parameters
$size : BoxInterface
$settings : mixed = ImageInterface::THUMBNAIL_INSET

One or more of the ManipulatorInterface::THUMBNAIL_ flags (joined with |). It may be a string for backward compatibility with old constant values that were strings.

$filter : mixed = ImageInterface::FILTER_UNDEFINED

The filter to use for resizing, one of ImageInterface::FILTER_*

Tags
see
ManipulatorInterface::thumbnail()
Return values
static

        
On this page

Search results