-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hello,
On some cases it can be usefull to call the optimus API for optimizing files from the filesystem.
For example here i'm using the "wpthumb" plugin for generating all the images sizes on the fly.
But this is not generating files for the webP only the png/jpg ones, but with only this lines of code :
<?php
add_action( 'wpthumb_saved_cache_image', function( WP_Thumb $wpthumb ) {
$file_path = $wpthumb->getCacheFilePath();
Optimus_Request::_do_image_action($file_path, array(
'file' => $wpthumb->getCacheFileURL(),
'webp' => true
));
} );I'm able to generate a webP version on the fly for our ressource, and with the right .htaccess rules the file is switched from png/jpg to the webP version :).
Is it possible to offer an API for optimizing any image file from the filesystem like the _do_image_action method can, because right now this is on private so unusable and duplicating all this code is not possible for us.
Rahe
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels