Image
in package
Image
This class is responsible for working with the image. Includes both direct methods for working with the image itself and auxiliary methods.
Table of Contents
Methods
- getImage() : string
- This function returns the original or a reduced version of the image.
- resize() : bool
- This function resizes the image, taking into account its orientation as well.
Methods
getImage()
This function returns the original or a reduced version of the image.
public
static getImage(string $url[, int $width = 0 ][, int $height = 0 ]) : string
In the case of a thumbnail image, it first searches for them in the cache, if the image was found, then it returns a link to it, if not, then decreases it, puts it in the cache and returns the link.
Parameters
- $url : string
- $width : int = 0
- $height : int = 0
Tags
Return values
string —Returns the public path to the image or an empty string if the image was not found or could not be processed.
resize()
This function resizes the image, taking into account its orientation as well.
public
static resize(string $path, string $to, int $new_width, int $new_height) : bool
Parameters
- $path : string
- $to : string
- $new_width : int
- $new_height : int
Tags
Return values
bool —Depends on imagejpeg function