-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from dscho/update-screenshots
Update screenshots
- Loading branch information
Showing
9 changed files
with
666 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.