Recent

GD_Driverclass

GD_Driver

Converts static images with the fallback GD extension.

Namespace: WebberZone\Image_Optimizer\Drivers
Since: 1.0.0
Source: includes/drivers/class-gd-driver.php line 19 Extends: Driver

Methods

is_available() static

Whether the GD extension is loaded.

Since: 1.0.0
Line: 28

static public function is_available(  ): bool;

Returns: bool — True when available.

get_name() static

Machine name of the driver.

Since: 1.0.0
Line: 39

static public function get_name(  ): string;

Returns: string — Driver slug.

supports()

Whether GD can encode the given format.

Since: 1.0.0
Line: 51

public function supports( string $format ): bool;
Type Name Description
string $format Target format slug.

Returns: bool — True when the encoder function exists.

convert()

Encode a source image into the target format.

Since: 1.0.0
Line: 77

public function convert( string $source, string $destination, string $format, array $args ): true|\WP_Error;
Type Name Description
string $source Absolute path to the source image.
string $destination Absolute path to write.
string $format Target format slug.
array $args

Returns: true|\WP_Error — True on success, WP_Error on failure.