Created
August 12, 2021 04:35
-
-
Save dealingwith/3cdc6420882928df72f9671fd8f366d7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let Jimp = await npm('jimp') | |
let width = await arg('New width in pixels') | |
let selectedFiles = await getSelectedFile(); | |
let filePaths = selectedFiles.split("\n"); | |
for (let filePath of filePaths) { | |
Jimp.read(filePath, (err, image) => { | |
if (err) throw err; | |
image.resize(parseInt(width), Jimp.AUTO).write(filePath); // save | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment