imagegd2
Function • Params changed in PHP 8.3
Output GD2 image to browser or file.
imagegd2 Function synopsis
imagegd2(
GdImage $image,
?string $file = null,
int $chunk_size = 128,
int $mode = IMG_GD2_RAW
): bool
Parameters
$image
TypeGdImage
$file
OptionalType?stringDefault valuenull
The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or null, the raw image stream will be output directly.
$chunk_size
OptionalTypeintDefault value128
Chunk size.
$mode
OptionalTypeintDefault valueIMG_GD2_RAW
Either IMG_GD2_RAW or
IMG_GD2_COMPRESSED. Default is
IMG_GD2_RAW.
Return value
Typebool
Returns true on success, false on failure
Changes to the imagegd2 Function
PHP 8.3
- Parameter default value changed for position #3 (
$chunk_size):<default>to128 - Parameter default value changed for position #4 (
$mode):<default>toIMG_GD2_RAW
imagegd2(
GdImage $image,
?string $file = null,
- int $chunk_size = <default>,
+ int $chunk_size = 128,
- int $mode = <default>
+ int $mode = IMG_GD2_RAW
): bool PHP 8.0
- Return type added:
bool - Parameter name of parameter #1 changed:
$imto$image - Parameter type added for parameter #1 (
$image):GdImage - Parameter name of parameter #2 changed:
$toto$file - Parameter type added for parameter #2 (
$file):?string - Parameter default value added for position #2 (
$file):null - Parameter type added for parameter #3 (
$chunk_size):int - Parameter default value added for position #3 (
$chunk_size):<default> - Parameter name of parameter #4 changed:
$typeto$mode - Parameter type added for parameter #4 (
$mode):int - Parameter default value added for position #4 (
$mode):<default>
imagegd2(
- $im,
+ GdImage $image,
- $to,
+ ?string $file = null,
- $chunk_size,
+ int $chunk_size = <default>,
- $type
+ int $mode = <default>
- )
+ ): bool PHP 7.1
- Parameter name of parameter #2 changed:
$filenameto$to
imagegd2(
$im,
- $filename,
+ $to,
$chunk_size,
$type
) imagegd2 Function Availability
imagegd2 Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |