Original_Driver
Original-file operations reuse the sidecar atomic writer.
Namespace: WebberZone\Image_Optimizer\Drivers
Since: 1.2.0
Source: includes/drivers/class-original-driver.php line 19
Extends: Driver
Methods
is_available() static
Check encoder availability.
Line: 27
static public function is_available( ): bool;
Returns: bool — Whether a JPEG encoder exists.
get_name() static
Identify the driver.
Line: 36
static public function get_name( ): string;
Returns: string — Driver slug.
supports()
Check the target.
Line: 46
public function supports( string $format ): bool;
| Type | Name | Description |
|---|---|---|
string |
$format |
Format. |
Returns: bool — Whether supported.
convert()
Encode a source without replacing it until validation succeeds.
Line: 59
public function convert( string $source, string $destination, string $format, array $args ): true|\WP_Error;
| Type | Name | Description |
|---|---|---|
string |
$source |
Input. |
string |
$destination |
Output. |
string |
$format |
Target format. |
array |
$args |
Encoding arguments. |
Returns: true|\WP_Error — Result.
restore()
Copy a verified image atomically for restore.
Line: 165
public function restore( string $source, string $destination ): true|\WP_Error;
| Type | Name | Description |
|---|---|---|
string |
$source |
Backup file. |
string |
$destination |
Served file. |
Returns: true|\WP_Error — Result.