Using wp_get_image_editor in a standalone script

Turns out I’m just silly.

WP_Error was the undefined method, not resize. I was sending a bad image location through the resize function. How silly of me! It was working all along.

I’ve included this on top

$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require_once( $parse_uri[0] . 'wp-load.php' );

and this is my image resize function

$image = wp_get_image_editor($current);

    if (!is_wp_error($image)) {
        $image->resize(100, 100, false);
        $image->save($target);
        return "succ";
    } else return "error";