Compare commits

..

2 Commits

Author SHA1 Message Date
Jim Liu 宝玉 3017bfe423 chore: release v1.95.1 2026-04-09 10:00:43 -05:00
Jim Liu 宝玉 ae1d619ab2 fix(baoyu-slide-deck): add pptxgenjs dependency and detect image format by magic bytes 2026-04-09 10:00:29 -05:00
6 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
},
"metadata": {
"description": "Skills shared by Baoyu for improving daily work efficiency",
"version": "1.95.0"
"version": "1.95.1"
},
"plugins": [
{
+5
View File
@@ -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
+5
View File
@@ -2,6 +2,11 @@
[English](./CHANGELOG.md) | 中文
## 1.95.1 - 2026-04-09
### 修复
- `baoyu-slide-deck`:添加 `pptxgenjs` 依赖,PDF 合并时通过魔数字节检测图片格式替代文件扩展名判断
## 1.95.0 - 2026-04-08
### 新功能
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -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);