Skip to content

Commit

Permalink
Merge pull request #33 from dscho/update-screenshots
Browse files Browse the repository at this point in the history
Update screenshots
  • Loading branch information
dscho authored Nov 20, 2021
2 parents 2dd628e + 8adbf01 commit 1c98497
Show file tree
Hide file tree
Showing 9 changed files with 666 additions and 0 deletions.
17 changes: 17 additions & 0 deletions create-screenshot-thumbnails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require('fs')
const jimp = require('jimp')

const generateThumbnail = async (inputPath, width, height, outputPath) => {
console.log(`Generating ${outputPath}`)
const image = await jimp.read(inputPath)
image.resize(width, height).write(outputPath)
}

(async () => {
for (const file of await fs.promises.readdir('img/')) {
const match = file.match(/^(gw\d+)\.png$/)
if (match) {
await generateThumbnail(`img/${match[1]}.png`, 315, 239, `img/${match[1]}web_thumb.png`)
}
}
})().catch(console.log)
Binary file modified img/gw1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/gw1web_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/gw2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/gw2web_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/gw3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/gw3web_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1c98497

Please sign in to comment.