Advertisement
pharmokan

Untitled

Apr 10th, 2020
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. const resizeImages = (files) => {
  2. for (let img of files) {
  3. var dims = sizeOf(img);
  4. let settings = dims.height > dims.width ? {height:1300} : {width: 2000}
  5. sharp(img)
  6. .resize({
  7. ...settings
  8. })
  9. .toFile(outputDir + img);
  10. }
  11. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement