Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- SETLOCAL
- echo =====================================================
- echo Convert .WEBP files to .PNG using Googles dwebp
- echo rob@stempnet.com
- echo =====================================================
- echo.
- set dwebpurl=https://developers.google.com/speed/webp/docs/precompiled
- where dwebp /Q
- if "%errorlevel%" NEQ "0" echo dwebp.exe NOT FOUND --- download from %dwebpurl% & exit /b 2
- for /d %%d in (*) do call :cnv "%%d"
- goto :end
- :cnv
- rem Convert
- rem ==============================================
- SETLOCAL
- set dirPath=%~1
- echo Processing folder "%dirPath%"........
- if NOT exist "%dirPath%\*.webp" exit /b 0
- pushd "%dirPath%"
- REM ---- convert ONLY if no .png version exists ------
- for %%a in (*.webp) do IF NOT EXIST "%%~na.png" dwebp %%a -o %%~na.png
- popd
- echo Processed "%dirPath%" completed!!!
- ENDLOCAL
- exit /b %errorlevel%
- :end
- pause
- ENDLOCAL
- echo.
- echo Conversion Completed!!
- echo.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement