Last active
February 5, 2019 06:24
-
-
Save patrickgalbraith/58374a2c16b6b319684fdb588d40be30 to your computer and use it in GitHub Desktop.
Resize all images in a folder
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
@echo off | |
cls | |
set "resolution=1080" | |
for /f "tokens=* delims=" %%G in ('dir /A-D /B *.jpg') do ( | |
ffmpeg -y -i "%%~G" -vf "scale='min(%resolution%,iw)':min'(%resolution%,ih)':force_original_aspect_ratio=decrease" "%%~G" | |
) | |
for /f "tokens=* delims=" %%G in ('dir /A-D /B *.png') do ( | |
ffmpeg -y -i "%%~G" -vf "scale='min(%resolution%,iw)':min'(%resolution%,ih)':force_original_aspect_ratio=decrease" "%%~G" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will overwrite all images in a folder with the resized version so make sure you have a backup!