mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-12 22:09:48 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3017bfe423 | |||
| ae1d619ab2 |
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Skills shared by Baoyu for improving daily work efficiency",
|
||||
"version": "1.95.0"
|
||||
"version": "1.95.1"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
English | [中文](./CHANGELOG.zh.md)
|
||||
|
||||
## 1.95.1 - 2026-04-09
|
||||
|
||||
### Fixes
|
||||
- `baoyu-slide-deck`: add `pptxgenjs` dependency and detect image format by magic bytes instead of file extension in PDF merge
|
||||
|
||||
## 1.95.0 - 2026-04-08
|
||||
|
||||
### Features
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
[English](./CHANGELOG.md) | 中文
|
||||
|
||||
## 1.95.1 - 2026-04-09
|
||||
|
||||
### 修复
|
||||
- `baoyu-slide-deck`:添加 `pptxgenjs` 依赖,PDF 合并时通过魔数字节检测图片格式替代文件扩展名判断
|
||||
|
||||
## 1.95.0 - 2026-04-08
|
||||
|
||||
### 新功能
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@
|
||||
"tsx": "^4.20.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"pdf-lib": "^1.17.1"
|
||||
"pdf-lib": "^1.17.1",
|
||||
"pptxgenjs": "^4.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ async function createPdf(slides: SlideInfo[], outputPath: string) {
|
||||
|
||||
for (const slide of slides) {
|
||||
const imageData = readFileSync(slide.path);
|
||||
const ext = slide.filename.toLowerCase();
|
||||
const image = ext.endsWith(".png")
|
||||
const isPng = imageData[0] === 0x89 && imageData[1] === 0x50 && imageData[2] === 0x4e && imageData[3] === 0x47;
|
||||
const image = isPng
|
||||
? await pdfDoc.embedPng(imageData)
|
||||
: await pdfDoc.embedJpg(imageData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user