You are here

protected function Upload::addWatermark in UEditor - 百度编辑器 8

添加水印

Parameters

$savePath:

Return value

string

3 calls to Upload::addWatermark()
UploadCatch::doUpload in src/Uploader/UploadCatch.php
UploadFile::doUpload in src/Uploader/UploadFile.php
UploadScrawl::doUpload in src/Uploader/UploadScrawl.php

File

src/Uploader/Upload.php, line 100

Class

Upload
UEditor编辑器通用上传类

Namespace

Drupal\ueditor\Uploader

Code

protected function addWatermark($savePath) {
  $watermark_type = $this->global_settings['ueditor_watermark_type'];
  $watermark_place = $this->global_settings['ueditor_watermark_place'];
  if ($watermark_type == 'image') {
    $watermark_path = $this->global_settings['ueditor_watermark_path'];
    $watermark_alpha = $this->global_settings['ueditor_watermark_alpha'];
    $success = $this
      ->imageWaterMark($savePath, $watermark_place, $watermark_path, $watermark_alpha);
  }
  else {
    global $base_url;
    $watermark_textcontent = $this->global_settings['ueditor_watermark_textcontent'];
    $watermark_textfontsize = $this->global_settings['ueditor_watermark_textfontsize'];
    $watermark_textcolor = $this->global_settings['ueditor_watermark_textcolor'];
    $success = $this
      ->imageWaterMark($savePath, $watermark_place, '', '', $watermark_textcontent, $watermark_textfontsize, $watermark_textcolor);
  }
  return $success;
}