File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ qiniu.compressImage(file, options).then(data => {
252
252
` ` ` JavaScript
253
253
const imgLink = qiniu.compressImage(file, options).then(res => {
254
254
// res : {
255
- // dist: 压缩后输出的 File 对象,或原始的 file ,具体看下面的 options 配置
255
+ // dist: 压缩后输出的 Blob 对象或原始的 File 对象,具体看下面的 options 配置
256
256
// width: 压缩后的图片宽度
257
257
// height: 压缩后的图片高度
258
258
// }
@@ -267,7 +267,7 @@ qiniu.compressImage(file, options).then(data => {
267
267
(注意:当 ` maxWidth` 和 ` maxHeight` 都不设置时,则采用原图尺寸大小)
268
268
* options .noCompressIfLarger : ` boolean` ,为 ` true` 时如果发现压缩后图片大小比原来还大,则返回源图片(即输出的 dist 直接返回了输入的 file);默认 ` false` ,即保证图片尺寸符合要求,但不保证压缩后的图片体积一定变小
269
269
* CompressResult: ` object` ,包含如下字段:
270
- * dist: 压缩后输出的 File 对象,或原始的 file,具体看下面的 options 配置
270
+ * dist: 压缩后输出的 Blob 对象或原始的 File 对象
271
271
* width: 压缩后的图片宽度
272
272
* height: 压缩后的图片高度
273
273
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface Dimension {
14
14
}
15
15
16
16
export interface CompressResult {
17
- dist : Blob
17
+ dist : Blob | File
18
18
width : number
19
19
height : number
20
20
}
You can’t perform that action at this time.
0 commit comments