function ctools_stylizer_image_processor::command_load

Create a new workspace a file.

This will make the new workspace the current workspace.

File

includes/stylizer.inc, line 318

Class

ctools_stylizer_image_processor

Code

function command_load($name, $file) {
    $this->log("New workspace: {$name} (from {$file})");
    if (!file_exists($file)) {
        // Try it relative to the plugin.
        $file = $this->plugin['path'] . '/' . $file;
        if (!file_exists($file)) {
            $this->log("Unable to open {$file}");
            return;
        }
    }
    // Clean up if there was already a workspace there.
    if (isset($this->workspaces[$name])) {
        imagedestroy($this->workspaces[$name]);
    }
    $this->workspaces[$name] = imagecreatefrompng($file);
    $this->set_current_workspace($name);
}