chatyou commited on
Commit
932f958
·
verified ·
1 Parent(s): 00bd809

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +1 -1
index.js CHANGED
@@ -22,7 +22,7 @@ app.get('/resize', async (req, res) => {
22
  console.log('原始图像大小:', imageBuffer.byteLength);
23
 
24
  // 使用 sharp 库来调整图像大小
25
- const resizedImageBuffer = await sharp(imageBuffer).resize(200).toBuffer();
26
  console.log('压缩后的图像大小:', resizedImageBuffer.byteLength);
27
 
28
  // 创建一个 FormData 对象并添加压缩后的图像
 
22
  console.log('原始图像大小:', imageBuffer.byteLength);
23
 
24
  // 使用 sharp 库来调整图像大小
25
+ const resizedImageBuffer = await sharp(imageBuffer).resize(100).toBuffer();
26
  console.log('压缩后的图像大小:', resizedImageBuffer.byteLength);
27
 
28
  // 创建一个 FormData 对象并添加压缩后的图像