You are here

public function PHPVideoToolkit::addGDWatermark in Video 7.2

Same name and namespace in other branches
  1. 7 libraries/phpvideotoolkit/phpvideotoolkit.php5.php \PHPVideoToolkit::addGDWatermark()

Adds a watermark to the outputted image files using the PHP GD module. This effects only image output.

@access public

Parameters

string $watermark_url The absolute path to the watermark image.:

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 2057
Libary to access FFmpeg

Class

PHPVideoToolkit

Code

public function addGDWatermark($watermark_url, $options = array(
  'x-offset' => 0,
  'y-offset' => 0,
  'position' => 'bottom-right',
)) {

  // 			does the file exist?
  if (!is_file($watermark_url)) {
    return $this
      ->_raiseError('addWatermark_img_404', array(
      'watermark' => $watermark_url,
    ));
  }

  // 			save the watermark_url
  $this->_watermark_url = $watermark_url;
  $this->_watermark_options = array_merge(array(
    'x-offset' => 0,
    'y-offset' => 0,
    'position' => 'bottom-right',
  ), $options);

  // 			register the post process
  $this
    ->registerPostProcess('_addGDWatermark', $this);
}