You are here

function ctools_stylizer_image_processor::command_merge_from_file in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/stylizer.inc \ctools_stylizer_image_processor::command_merge_from_file()

Blend an image into the current workspace.

File

includes/stylizer.inc, line 404
Create customized CSS and images from palettes created by user input.

Class

ctools_stylizer_image_processor

Code

function command_merge_from_file($file, $x = 0, $y = 0) {
  $this
    ->log("Merge from file: {$file} ({$x}, {$y})");
  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;
    }
  }
  $source = imagecreatefrompng($file);
  $this
    ->merge($source, $this->workspace, $x, $y);
  imagedestroy($source);
}