Skip to content

Instantly share code, notes, and snippets.

@BolajiAyodeji
Created February 20, 2022 21:12
Show Gist options
  • Save BolajiAyodeji/c2270e9b93d6383343fca0046c9f9525 to your computer and use it in GitHub Desktop.
Save BolajiAyodeji/c2270e9b93d6383343fca0046c9f9525 to your computer and use it in GitHub Desktop.
const gm = require("gm").subClass({ imageMagick: true });
const fs = require("fs");
const images = fs.readdirSync("./images");
images.forEach((image) => {
gm(`./images/${image}`).write(
`./prc/${image.slice(0, 11)}.jpg`,
(err) => {
if (!err) console.log("✅ done");
}
);
});
// gm(`./images/${matnum}`).identify(function (err, data) {
// if (!err) console.log(data);
// });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment