Created
March 2, 2021 08:08
-
-
Save blockworks/105ef3e26d32a872528fea3536898ff9 to your computer and use it in GitHub Desktop.
cwebpを使ったbatファイル
This file contains 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 | |
cd /d %~dp1 | |
for %%q in (%*) do ( | |
echo TARGET FILE : %%~nxq | |
REM *** PNG FILE *** | |
if %%~xq == .png ( | |
call :OPTIMIZE_WEBP "%%~nxq" | |
) | |
if %%~xq == .PNG ( | |
call :OPTIMIZE_WEBP "%%~nxq" | |
) | |
REM *** JPEG FILE *** | |
if %%~xq == .jpg ( | |
call :OPTIMIZE_WEBP "%%~nxq" | |
) | |
if %%~xq == .JPG ( | |
call :OPTIMIZE_WEBP "%%~nxq" | |
) | |
echo. | |
) | |
PAUSE | |
exit /b | |
REM *** SUBROUTINE *** | |
:OPTIMIZE_WEBP | |
cwebp.exe -q 75 -metadata icc -sharp_yuv -o %~n1.webp %1 | |
del /F quantized_%1 | |
exit /b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment