提交的内容

This commit is contained in:
2025-05-12 15:45:02 +08:00
parent 629c4750da
commit b48c692775
3043 changed files with 34732 additions and 60810 deletions

View File

@ -8,6 +8,7 @@ class BlindWatermarkTemplate extends ImageTemplate {
private $image;
private $text;
private $level;
private $version;
public function __construct() {
parent::__construct();
@ -16,6 +17,7 @@ class BlindWatermarkTemplate extends ImageTemplate {
$this->image = "";
$this->text = "";
$this->level = "";
$this->version = "";
}
@ -38,6 +40,9 @@ class BlindWatermarkTemplate extends ImageTemplate {
public function setLevel($value) {
$this->level = "/level/" . $value;
}
public function setVersion($value) {
$this->version = "/version/" . $value;
}
public function getType() {
return $this->type;
@ -55,6 +60,10 @@ class BlindWatermarkTemplate extends ImageTemplate {
return $this->level;
}
public function getVersion() {
return $this->version;
}
public function queryString() {
$head = "watermark/$this->markType";
@ -71,6 +80,9 @@ class BlindWatermarkTemplate extends ImageTemplate {
if($this->level){
$res .= $this->level;
}
if($this->version){
$res .= $this->version;
}
if($res){
$res = $head . $res;
}
@ -83,5 +95,6 @@ class BlindWatermarkTemplate extends ImageTemplate {
$this->image = "";
$this->text = "";
$this->level = "";
$this->version = "";
}
}

View File

View File

View File

View File

@ -4,34 +4,68 @@ namespace Qcloud\Cos\ImageParamTemplate;
class ImageQrcodeTemplate extends ImageTemplate
{
private $mode;
private $cover;
private $barType;
private $segment;
private $size;
public function __construct() {
parent::__construct();
$this->mode = "";
$this->cover = "";
$this->barType = "";
$this->segment = "";
$this->size = "";
}
public function setMode($mode) {
$this->mode = "/cover/" . $mode;
public function setCover($cover) {
$this->cover = "/cover/" . $cover;
}
public function getCover() {
return $this->cover;
}
public function getMode() {
return $this->mode;
public function setBarType($barType) {
$this->barType = "/bar-type/" . $barType;
}
public function getBarType() {
return $this->barType;
}
public function setSegment($segment) {
$this->segment = "/segmente/" . $segment;
}
public function getSegment() {
return $this->segment;
}
public function setSize($size) {
$this->size = "/size/" . $size;
}
public function getSize() {
return $this->size;
}
public function queryString() {
$head = "QRcode";
$res = "";
if($this->mode) {
$res .= $this->mode;
$res = "QRcode";
if($this->cover) {
$res .= $this->cover;
}
if($res) {
$res = $head . $res;
if($this->barType) {
$res .= $this->barType;
}
if($this->segment) {
$res .= $this->segment;
}
if($this->size) {
$res .= $this->size;
}
return $res;
}
public function resetRule() {
$this->mode = "";
$this->cover = "";
$this->barType = "";
$this->segment = "";
$this->size = "";
}
}

View File

@ -0,0 +1,8 @@
<?php
namespace Qcloud\Cos\ImageParamTemplate;
class ImageSlimTemplate extends ImageTemplate {
public function queryString() {
return "imageSlim";
}
}

View File

0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php vendored Executable file → Normal file
View File

View File

View File

@ -6,6 +6,7 @@ class ImageWatermarkTemplate extends ImageTemplate
{
private $image;
private $imageKey;
private $gravity;
private $dx;
private $dy;
@ -14,11 +15,13 @@ class ImageWatermarkTemplate extends ImageTemplate
private $spcent;
private $dissolve;
private $batch;
private $spacing;
private $degree;
public function __construct() {
parent::__construct();
$this->image = "";
$this->imageKey = "";
$this->gravity = "";
$this->dx = "";
$this->dy = "";
@ -27,6 +30,7 @@ class ImageWatermarkTemplate extends ImageTemplate
$this->spcent = "";
$this->dissolve = "";
$this->batch = "";
$this->spacing = "";
$this->degree = "";
}
@ -38,6 +42,14 @@ class ImageWatermarkTemplate extends ImageTemplate
$this->image = "/image/" . $this->ciBase64($value);
}
/**
* 如果您在添加水印时不希望暴露水印所在的图片地址,可使用该参数。
* @param $value
*/
public function setImageKey($value) {
$this->imageKey = "/image_key/" . $this->ciBase64($value);
}
/**
* 图片水印位置,九宫格位置(参考九宫格方位图 ),默认值 SouthEast
* @param $value
@ -110,6 +122,14 @@ class ImageWatermarkTemplate extends ImageTemplate
$this->batch = "/batch/" . $value;
}
/**
* 平铺水印功能,宽高百分比
* @param $value
*/
public function setSpacing($value) {
$this->spacing = "/spacing/" . $value;
}
/**
* 当 batch 值为1时生效。图片水印的旋转角度设置取值范围为0 - 360默认0
* @param $value
@ -122,6 +142,10 @@ class ImageWatermarkTemplate extends ImageTemplate
return $this->image;
}
public function getImageKey() {
return $this->imageKey;
}
public function getGravity() {
return $this->gravity;
}
@ -154,6 +178,10 @@ class ImageWatermarkTemplate extends ImageTemplate
return $this->batch;
}
public function getSpacing() {
return $this->spacing;
}
public function getDegree() {
return $this->degree;
}
@ -164,6 +192,9 @@ class ImageWatermarkTemplate extends ImageTemplate
if($this->image) {
$res .= $this->image;
}
if($this->imageKey) {
$res .= $this->imageKey;
}
if($this->gravity) {
$res .= $this->gravity;
}
@ -188,6 +219,9 @@ class ImageWatermarkTemplate extends ImageTemplate
if($this->batch) {
$res .= $this->batch;
}
if($this->spacing) {
$res .= $this->spacing;
}
if($this->degree) {
$res .= $this->degree;
}
@ -199,6 +233,7 @@ class ImageWatermarkTemplate extends ImageTemplate
public function resetRule() {
$this->image = "";
$this->imageKey = "";
$this->gravity = "";
$this->dx = "";
$this->dy = "";
@ -207,6 +242,7 @@ class ImageWatermarkTemplate extends ImageTemplate
$this->spcent = "";
$this->dissolve = "";
$this->batch = "";
$this->spacing = "";
$this->degree = "";
}
}

View File

View File

@ -16,6 +16,7 @@ class TextWatermarkTemplate extends ImageTemplate
private $dx;
private $dy;
private $batch;
private $spacing;
private $degree;
private $shadow;
private $scatype;
@ -32,6 +33,7 @@ class TextWatermarkTemplate extends ImageTemplate
$this->dx = "";
$this->dy = "";
$this->batch = "";
$this->spacing = "";
$this->degree = "";
$this->shadow = "";
$this->scatype = "";
@ -74,6 +76,10 @@ class TextWatermarkTemplate extends ImageTemplate
$this->batch = "/batch/" . $value;
}
public function setSpacing($value) {
$this->spacing = "/spacing/" . $value;
}
public function setDegree($value) {
$this->degree = "/degree/" . $value;
}
@ -126,6 +132,10 @@ class TextWatermarkTemplate extends ImageTemplate
return $this->batch;
}
public function getSpacing() {
return $this->spacing;
}
public function getDegree() {
return $this->degree;
}
@ -172,6 +182,9 @@ class TextWatermarkTemplate extends ImageTemplate
if($this->batch) {
$res .= $this->batch;
}
if($this->spacing) {
$res .= $this->spacing;
}
if($this->degree) {
$res .= $this->degree;
}
@ -200,6 +213,7 @@ class TextWatermarkTemplate extends ImageTemplate
$this->dx = "";
$this->dy = "";
$this->batch = "";
$this->spacing = "";
$this->degree = "";
$this->shadow = "";
$this->scatype = "";