File tree Expand file tree Collapse file tree 5 files changed +33
-0
lines changed Expand file tree Collapse file tree 5 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ export const EN: ILocales = {
40
40
PICBED_TENCENTCLOUD_ENDPOINT : 'Set Endpoint' ,
41
41
PICBED_TENCENTCLOUD_PATH : 'Set Path' ,
42
42
PICBED_TENCENTCLOUD_OPTIONS : 'Set URL Suffix' ,
43
+ PICBED_TENCENTCLOUD_SLIM : 'Set ImageSlim' ,
44
+ PICBED_TENCENTCLOUD_SLIM_TIP : 'Image extremely intelligent compression, please refer to the [document description](https://cloud.tencent.com/document/product/436/49259)' ,
45
+ PICBED_TENCENTCLOUD_SLIM_CONFIRM : 'OPEN' ,
46
+ PICBED_TENCENTCLOUD_SLIM_CANCEL : 'CLOSE' ,
43
47
PICBED_TENCENTCLOUD_CUSTOMURL : 'Set Custom URL' ,
44
48
PICBED_TENCENTCLOUD_MESSAGE_APPID : 'Ex. 1234567890' ,
45
49
PICBED_TENCENTCLOUD_MESSAGE_AREA : 'Ex. ap-beijing' ,
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ export const ZH_CN = {
39
39
PICBED_TENCENTCLOUD_PATH : '设定存储路径' ,
40
40
PICBED_TENCENTCLOUD_OPTIONS : '设定网址后缀' ,
41
41
PICBED_TENCENTCLOUD_CUSTOMURL : '设定自定义域名' ,
42
+ PICBED_TENCENTCLOUD_SLIM : '极智压缩' ,
43
+ PICBED_TENCENTCLOUD_SLIM_TIP : '图片极智压缩,详情请参考[文档说明](https://cloud.tencent.com/document/product/436/49259)' ,
44
+ PICBED_TENCENTCLOUD_SLIM_CONFIRM : '开启' ,
45
+ PICBED_TENCENTCLOUD_SLIM_CANCEL : '关闭' ,
42
46
PICBED_TENCENTCLOUD_MESSAGE_APPID : '例如:1234567890' ,
43
47
PICBED_TENCENTCLOUD_MESSAGE_AREA : '例如:ap-beijing' ,
44
48
PICBED_TENCENTCLOUD_MESSAGE_ENDPOINT : '例如:cos-internal.accelerate.tencentcos.cn' ,
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ export const ZH_TW: ILocales = {
40
40
PICBED_TENCENTCLOUD_ENDPOINT : '設定Endpoint' ,
41
41
PICBED_TENCENTCLOUD_PATH : '設定儲存路徑' ,
42
42
PICBED_TENCENTCLOUD_OPTIONS : '設定網址後綴' ,
43
+ PICBED_TENCENTCLOUD_SLIM : '極智壓縮' ,
44
+ PICBED_TENCENTCLOUD_SLIM_CANCEL : '關閉' ,
45
+ PICBED_TENCENTCLOUD_SLIM_CONFIRM : '開啓' ,
46
+ PICBED_TENCENTCLOUD_SLIM_TIP : '圖片極智壓縮,詳情請參考[文檔說明](https://cloud.tencent.com/document/product/436/49259)' ,
43
47
PICBED_TENCENTCLOUD_CUSTOMURL : '設定自訂網址' ,
44
48
PICBED_TENCENTCLOUD_MESSAGE_APPID : '例如:1234567890' ,
45
49
PICBED_TENCENTCLOUD_MESSAGE_AREA : '例如:ap-beijing' ,
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
134
134
}
135
135
}
136
136
const optionUrl = tcYunOptions . options || ''
137
+ const slim = tcYunOptions . slim || ''
137
138
if ( useV4 && body . message === 'SUCCESS' ) {
138
139
delete img . base64Image
139
140
delete img . buffer
@@ -154,6 +155,13 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
154
155
} else {
155
156
throw new Error ( res . body . msg )
156
157
}
158
+ if ( slim ) {
159
+ if ( optionUrl ) {
160
+ img . imgUrl += '&imageSlim'
161
+ } else {
162
+ img . imgUrl += '?imageSlim'
163
+ }
164
+ }
157
165
}
158
166
}
159
167
return ctx
@@ -259,6 +267,17 @@ const config = (ctx: IPicGo): IPluginConfig[] => {
259
267
get alias ( ) { return ctx . i18n . translate < ILocalesKey > ( 'PICBED_TENCENTCLOUD_OPTIONS' ) } ,
260
268
get message ( ) { return ctx . i18n . translate < ILocalesKey > ( 'PICBED_TENCENTCLOUD_MESSAGE_OPTIONS' ) } ,
261
269
required : false
270
+ } ,
271
+ {
272
+ name : 'slim' ,
273
+ type : 'confirm' ,
274
+ default : userConfig . options || '' ,
275
+ get prefix ( ) { return ctx . i18n . translate < ILocalesKey > ( 'PICBED_TENCENTCLOUD_SLIM' ) } ,
276
+ get alias ( ) { return ctx . i18n . translate < ILocalesKey > ( 'PICBED_TENCENTCLOUD_SLIM' ) } ,
277
+ required : false ,
278
+ get confirmText ( ) { return ctx . i18n . translate < ILocalesKey > ( 'PICBED_TENCENTCLOUD_SLIM_CONFIRM' ) } ,
279
+ get cancelText ( ) { return ctx . i18n . translate < ILocalesKey > ( 'PICBED_TENCENTCLOUD_SLIM_CANCEL' ) } ,
280
+ get tips ( ) { return ctx . i18n . translate < ILocalesKey > ( 'PICBED_TENCENTCLOUD_SLIM_TIP' ) } ,
262
281
}
263
282
]
264
283
return config
Original file line number Diff line number Diff line change @@ -331,6 +331,8 @@ export interface ITcyunConfig {
331
331
version : 'v5' | 'v4'
332
332
/** 针对图片的一些后缀处理参数 PicGo 2.4.0+ PicGo-Core 1.5.0+ */
333
333
options : string
334
+ /** 是否支持极智压缩 */
335
+ slim : boolean
334
336
}
335
337
/** GitHub 图床配置项 */
336
338
export interface IGithubConfig {
You can’t perform that action at this time.
0 commit comments