function ctools_stylizer_image_processor::execute

File

includes/stylizer.inc, line 243

Class

ctools_stylizer_image_processor

Code

function execute($path, $plugin, $settings) {
    $this->path = $path;
    $this->plugin = $plugin;
    $this->settings = $settings;
    $this->palette = $settings['palette'];
    if (is_string($plugin['actions']) && function_exists($plugin['actions'])) {
        $actions = $plugin['actions']($plugin, $settings);
    }
    elseif (is_array($plugin['actions'])) {
        $actions = $plugin['actions'];
    }
    if (!empty($actions) && is_array($actions)) {
        foreach ($plugin['actions'] as $action) {
            $command = 'command_' . array_shift($action);
            if (method_exists($this, $command)) {
                call_user_func_array(array(
                    $this,
                    $command,
                ), $action);
            }
        }
    }
    // Clean up buffers.
    foreach ($this->workspaces as $name => $workspace) {
        imagedestroy($this->workspaces[$name]);
    }
}