Methods |
public
static
|
createFromString(string $image_data): ImageResize
Create instance from a strng
Create instance from a strng
Throws
|
#
|
public
|
addFilter(callable $filter): $this
Add filter function for use right before save image to file.
Add filter function for use right before save image to file.
|
#
|
protected
|
applyFilter($image, $filterType = IMG_FILTER_NEGATE)
Apply filters.
|
#
|
public
|
__construct(string $filename): ImageResize
Loads image source and its properties to the instanciated object
Loads image source and its properties to the instanciated object
Throws
|
#
|
public
|
imageCreateJpegfromExif($filename)
|
#
|
public
|
save(
string $filename,
integer $image_type = null,
integer $quality = null,
integer $permissions = null,
boolean $exact_size = false,
): static
Saves new image
|
#
|
public
|
getImageAsString(int $image_type = null, int $quality = null): string
Convert the image to string
Convert the image to string
|
#
|
public
|
__toString(): string
Convert the image to string with the current settings
Convert the image to string with the current settings
|
#
|
public
|
output(string $image_type = null, integer $quality = null)
Outputs image to browser
|
#
|
public
|
resizeToShortSide(integer $max_short, boolean $allow_enlarge = false): static
Resizes image according to the given short side (short side proportional)
Resizes image according to the given short side (short side proportional)
|
#
|
public
|
resizeToLongSide(integer $max_long, boolean $allow_enlarge = false): static
Resizes image according to the given long side (short side proportional)
Resizes image according to the given long side (short side proportional)
|
#
|
public
|
resizeToHeight(integer $height, boolean $allow_enlarge = false): static
Resizes image according to the given height (width proportional)
Resizes image according to the given height (width proportional)
|
#
|
public
|
resizeToWidth(integer $width, boolean $allow_enlarge = false): static
Resizes image according to the given width (height proportional)
Resizes image according to the given width (height proportional)
|
#
|
public
|
resizeToBestFit(integer $max_width, integer $max_height, boolean $allow_enlarge = false): static
Resizes image to best fit inside the given dimensions
Resizes image to best fit inside the given dimensions
|
#
|
public
|
scale(integer|float $scale): static
Resizes image according to given scale (proportionally)
Resizes image according to given scale (proportionally)
|
#
|
public
|
resize(integer $width, integer $height, boolean $allow_enlarge = false): static
Resizes image according to the given width and height
Resizes image according to the given width and height
|
#
|
public
|
crop(integer $width, integer $height, boolean $allow_enlarge = false, integer $position = self::CROPCENTER): static
Crops image according to the given width, height and crop position
Crops image according to the given width, height and crop position
|
#
|
public
|
freecrop(integer $width, integer $height, integer $x = false, integer $y = false): static
Crops image according to the given width, height, x and y
Crops image according to the given width, height, x and y
|
#
|
public
|
getSourceWidth(): integer
Gets source width
|
#
|
public
|
getSourceHeight(): integer
Gets source height
|
#
|
public
|
getDestWidth(): integer
Gets width of the destination image
Gets width of the destination image
|
#
|
public
|
getDestHeight(): integer
Gets height of the destination image
Gets height of the destination image
|
#
|
protected
|
getCropPosition(integer $expectedSize, integer $position = self::CROPCENTER): integer
Gets crop position (X or Y) according to the given position
Gets crop position (X or Y) according to the given position
|
#
|
public
|
gamma(bool $enable = false): static
Enable or not the gamma color correction on the image, enabled by default
Enable or not the gamma color correction on the image, enabled by default
|
#
|