imageresolution
Function • Return type changed in PHP 8.5
Get or set the resolution of the image.
imageresolution Function synopsis
imageresolution(
GdImage $image,
?int $resolution_x = null,
?int $resolution_y = null
): array|true
Parameters
$image
TypeGdImage
$resolution_x
OptionalType?intDefault valuenull
The horizontal resolution in DPI.
$resolution_y
OptionalType?intDefault valuenull
The vertical resolution in DPI.
Return value
Typearray|true
When used as getter,
it returns an indexed array of the horizontal and vertical resolution on
success, or false on failure.
When used as setter, it returns
true on success, or false on failure.
Changes to the imageresolution Function
PHP 8.5
- Return type changed:
array|booltoarray|true
imageresolution(
GdImage $image,
?int $resolution_x = null,
?int $resolution_y = null
- ): array|bool
+ ): array|true PHP 8.0
- Return type added:
array|bool - Parameter name of parameter #1 changed:
$imto$image - Parameter type added for parameter #1 (
$image):GdImage - Parameter name of parameter #2 changed:
$res_xto$resolution_x - Parameter type added for parameter #2 (
$resolution_x):?int - Parameter default value added for position #2 (
$resolution_x):null - Parameter name of parameter #3 changed:
$res_yto$resolution_y - Parameter type added for parameter #3 (
$resolution_y):?int - Parameter default value added for position #3 (
$resolution_y):null
imageresolution(
- $im,
+ GdImage $image,
- $res_x,
+ ?int $resolution_x = null,
- $res_y
+ ?int $resolution_y = null
- )
+ ): array|bool PHP 7.2
- Function added
imageresolution Function Availability
imageresolution Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Future Release | Yes |
| PHP 8.5Upcoming Release | Yes |
| PHP 8.4Supported (Latest) | Yes |
| PHP 8.3Supported | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Security-Fixes Only | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | No |
| PHP 7.0Unsupported | No |
| PHP 5.6Unsupported | No |
| PHP 5.5Unsupported | No |
| PHP 5.4Unsupported | No |
| PHP 5.3Unsupported | No |