Skip to content

Commit 1c98497

Browse files
authored
Merge pull request #33 from dscho/update-screenshots
Update screenshots
2 parents 2dd628e + 8adbf01 commit 1c98497

9 files changed

+666
-0
lines changed

Diff for: create-screenshot-thumbnails.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const fs = require('fs')
2+
const jimp = require('jimp')
3+
4+
const generateThumbnail = async (inputPath, width, height, outputPath) => {
5+
console.log(`Generating ${outputPath}`)
6+
const image = await jimp.read(inputPath)
7+
image.resize(width, height).write(outputPath)
8+
}
9+
10+
(async () => {
11+
for (const file of await fs.promises.readdir('img/')) {
12+
const match = file.match(/^(gw\d+)\.png$/)
13+
if (match) {
14+
await generateThumbnail(`img/${match[1]}.png`, 315, 239, `img/${match[1]}web_thumb.png`)
15+
}
16+
}
17+
})().catch(console.log)

Diff for: img/gw1.png

42.5 KB
Loading

Diff for: img/gw1web_thumb.png

-32.9 KB
Loading

Diff for: img/gw2.png

229 KB
Loading

Diff for: img/gw2web_thumb.png

-10.1 KB
Loading

Diff for: img/gw3.png

198 KB
Loading

Diff for: img/gw3web_thumb.png

20.6 KB
Loading

0 commit comments

Comments
 (0)