beejournal/imageconv.py

9 lines
260 B
Python
Raw Permalink Normal View History

2022-03-02 22:32:08 +00:00
import glob
from pathlib import Path
import subprocess
for filename in glob.glob("images_too_big/*"):
pathfn = Path(filename)
outpathfn = Path("images/")/pathfn.name
2022-03-02 22:35:39 +00:00
subprocess.run(["convert", f"{pathfn}", "-resize", "1000x1000", f"{outpathfn}"])