Browse Source

图片处理类命名规范

tags/6.2.11
tianya 9 months ago
parent
commit
4c3922105c
3 changed files with 13 additions and 9 deletions
  1. +8
    -4
      src/system/dedeimage.class.php
  2. +3
    -3
      src/system/dedetemplate.class.php
  3. +2
    -2
      src/system/helpers/image.helper.php

src/system/image.class.php → src/system/dedeimage.class.php View File

@@ -3,13 +3,13 @@ if (!defined('DEDEINC')) exit ('dedebiz');
/**
* 图像处理
*
* @version $id:image.class.php 18:10 2010年7月5日 tianya $
* @version $id:dedeimage.class.php 18:10 2010年7月5日 tianya $
* @package DedeBIZ.Libraries
* @copyright Copyright (c) 2022 DedeBIZ.COM
* @license GNU GPL v2 (https://www.dedebiz.com/license)
* @link https://www.dedebiz.com
*/
class image
class DedeImage
{
var $attachinfo;
var $targetfile; //图片路径
@@ -21,8 +21,12 @@ class image
var $watermarktext;
var $thumbstatus;
var $watermarkstatus;
var $watermarkminwidth;
var $watermarkminheight;
var $watermarktype;
var $watermarktrans;
//析构函数,兼容PHP4
function image($targetfile, $cfg_thumb, $cfg_watermarktext, $photo_waterpos, $photo_diaphaneity, $photo_wheight, $photo_wwidth, $cfg_watermarktype, $photo_marktrans, $trueMarkimg, $attach = array())
function DedeImage($targetfile, $cfg_thumb, $cfg_watermarktext, $photo_waterpos, $photo_diaphaneity, $photo_wheight, $photo_wwidth, $cfg_watermarktype, $photo_marktrans, $trueMarkimg, $attach = array())
{
$this->__construct($targetfile, $cfg_thumb, $cfg_watermarktext, $photo_waterpos, $photo_diaphaneity, $photo_wheight, $photo_wwidth, $cfg_watermarktype, $photo_marktrans, $trueMarkimg, $attach);
}
@@ -76,7 +80,7 @@ class image
{
$this->thumb_gd($thumbwidth, $thumbheight, $preview);
if ($this->thumbstatus == 2 && $this->watermarkstatus) {
$this->image(
$this->DedeImage(
$this->targetfile,
$this->attach,
$this->watermarktext,

+ 3
- 3
src/system/dedetemplate.class.php View File

@@ -30,7 +30,7 @@ function MakePublicTag($atts = array(), $refObj = '', $fields = array())
*
* @access public
* @param array $atts 属性
* @param array $attlist 属性列表
* @param string $attlist 属性列表
* @return void
*/
function FillAtts(&$atts, $attlist="")
@@ -485,7 +485,7 @@ class DedeTemplate
return;
}
$cAtt = new TagAttributeParse();
$cAtt->CharToLow = TRUE;
$cAtt->charToLow = TRUE;
//遍历模板字符串,请取标记及其属性信息
$t = 0;
$preTag = '';
@@ -883,7 +883,7 @@ class DedeTemplate
* 编译if标记
*
* @access public
* @param string $cTag 标签
* @param object $cTag 标签
* @return string
*/
function Compilerif ($cTag)


+ 2
- 2
src/system/helpers/image.helper.php View File

@@ -76,7 +76,7 @@ if (!function_exists('WaterImg')) {
function WaterImg($srcFile, $fromGo = 'up')
{
include(DEDEDATA.'/mark/inc_photowatermark_config.php');
require_once(DEDEINC.'/image.class.php');
require_once(DEDEINC.'/dedeimage.class.php');
if (isset($GLOBALS['needwatermark'])) {
$photo_markup = $photo_markdown = empty($GLOBALS['needwatermark']) ? '0' : '1';
}
@@ -119,7 +119,7 @@ if (!function_exists('WaterImg')) {
$cfg_watermarktext['shadowy'] = '0';
$cfg_watermarktext['shadowcolor'] = '0,0,0';
$photo_marktrans = 85;
$img = new image($srcFile, 0, $cfg_watermarktext, $photo_waterpos, $photo_diaphaneity, $photo_wheight, $photo_wwidth, $photo_marktype, $photo_marktrans, $TRUEMarkimg);
$img = new DedeImage($srcFile, 0, $cfg_watermarktext, $photo_waterpos, $photo_diaphaneity, $photo_wheight, $photo_wwidth, $photo_marktype, $photo_marktrans, $TRUEMarkimg);
$img->watermark(0);
}
}


Loading…
Cancel
Save