Image helpers.
More...
|
static | fromFile ($filename) |
| Create an image resource from file. More...
|
|
static | dataUri ($image, $type=IMAGETYPE_JPEG, $quality=75) |
| Convert an image resource to base64 encoded uri. More...
|
|
static | scaleBox ($image, $width, $height, $options=0, $mode=IMG_BILINEAR_FIXED) |
| Scale an image resource to fit a certain box size, maintaining aspect ratio. More...
|
|
Image helpers.
Definition at line 8 of file Image.php.
◆ dataUri()
static dataUri |
( |
|
$image, |
|
|
|
$type = IMAGETYPE_JPEG , |
|
|
|
$quality = 75 |
|
) |
| |
|
static |
Convert an image resource to base64 encoded uri.
- Parameters
-
resource | $image | Image resource. |
string | $type | Output image type (see PHP's IMAGETYPE_* constants). |
int | $quality | Quality for JPEG or PNG format. |
- Returns
- string False if unsupported type.
Definition at line 29 of file Image.php.
◆ fromFile()
static fromFile |
( |
|
$filename | ) |
|
|
static |
Create an image resource from file.
- Parameters
-
string | $filename | Image filename. |
- Returns
- resource Image resource (false if the image type is unsupported, the data is not in a recognised format, or the image is corrupt and cannot be loaded).
Definition at line 19 of file Image.php.
◆ scaleBox()
static scaleBox |
( |
|
$image, |
|
|
|
$width, |
|
|
|
$height, |
|
|
|
$options = 0 , |
|
|
|
$mode = IMG_BILINEAR_FIXED |
|
) |
| |
|
static |
Scale an image resource to fit a certain box size, maintaining aspect ratio.
- Parameters
-
- Returns
- resource Scaled image resource, or false on failure (including image smaller than requested dimension and IMAGE_SCALE_ONLY_SMALLER in options).
Definition at line 57 of file Image.php.
◆ IMAGE_SCALE_INSIDE
const IMAGE_SCALE_INSIDE = 1 |
Scale image inside box (normally it will scale to fit at least the box).
Definition at line 10 of file Image.php.
◆ IMAGE_SCALE_ONLY_SMALLER
const IMAGE_SCALE_ONLY_SMALLER = 2 |
Only make an image smaller, not larger.
Definition at line 11 of file Image.php.
The documentation for this class was generated from the following file:
- /var/www/fred.local/vendor/rsi/helpers/src/Rsi/Image.php