Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass _do_image_action public #11

Open
Rahe opened this issue Nov 14, 2019 · 2 comments
Open

Pass _do_image_action public #11

Rahe opened this issue Nov 14, 2019 · 2 comments

Comments

@Rahe
Copy link

Rahe commented Nov 14, 2019

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

@svenba svenba changed the title [Feature] Pass _do_image_action public Pass _do_image_action public Apr 15, 2020
@asadowski10
Copy link

Hi team,

I have the same problem of @Rahe
Can you give us visibility on the feasibility?

Best,

@chrillep
Copy link

@svenba ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants