nagose commited on
Commit
d728393
·
verified ·
1 Parent(s): f07887f

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +7 -6
index.js CHANGED
@@ -91,15 +91,16 @@ app.post('/upload', upload.single('file'), async (req, res) => {
91
  ctx.font = '20px WenQuanYi Zen Hei';
92
 
93
  const text = `
94
- File Name: ${fileName}
95
- File Type: ${fileType}
96
- File Size: ${fileBuffer.length} bytes
97
- Created At: ${new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })}
98
- Created By: ${hostname}
 
99
 
100
- `;
101
  ctx.fillText(text.trim(), 10, 100);
102
  const rawImageData = canvas.toBuffer('image/jpeg', { quality: 0.75 });
 
103
  const finalBuffer = Buffer.concat([rawImageData, zipBuffer]);
104
  const outputFileName = encodeURIComponent(fileName.replace(/\.[^/.]+$/, "") + '-pic.zip.jpg');
105
 
 
91
  ctx.font = '20px WenQuanYi Zen Hei';
92
 
93
  const text = `
94
+ File Name: ${fileName}
95
+ File Type: ${fileType}
96
+ File Size: ${fileBuffer.length} bytes
97
+ Created At: ${new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })}
98
+ Created By: ${hostname}
99
+ `;
100
 
 
101
  ctx.fillText(text.trim(), 10, 100);
102
  const rawImageData = canvas.toBuffer('image/jpeg', { quality: 0.75 });
103
+
104
  const finalBuffer = Buffer.concat([rawImageData, zipBuffer]);
105
  const outputFileName = encodeURIComponent(fileName.replace(/\.[^/.]+$/, "") + '-pic.zip.jpg');
106