-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpwa-icon-packer.cmd
44 lines (36 loc) · 1.59 KB
/
pwa-icon-packer.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@echo off
rem Set a local scope, allowing for delayed expansion of variables
setlocal EnableDelayedExpansion
rem Get the directory where the script resides using %~dp0
set "search_dir=%~dp0"
rem Define a output directory
set "output_dir=icons"
rem Loop through all files with "x" in the filename in the script directory and its subdirectories
echo Searching for x files...
echo.
for /R "%search_dir%" %%i in (*x*.*) do (
rem Output the full path, filename, and extension of each file
echo X File: %%i
echo Filename without extension: %%~ni
echo File Extension: %%~xi
rem Remove all files with the "x" in the filename
del "%%i"
)
rem Loop through all image files in the script directory and its subdirectories
echo.
echo Searching for logo...
echo.
rem look for a "logo.png" file in %search_dir%..\img\
for /R "%search_dir%..\img\" %%i in (logo.png) do (
ffmpeg -loglevel quiet -y -i "%%i" -vf scale=72:72 "%~dp0%output_dir%/72x72%%~xi"
ffmpeg -loglevel quiet -y -i "%%i" -vf scale=96:96 "%~dp0%output_dir%/96x96%%~xi"
ffmpeg -loglevel quiet -y -i "%%i" -vf scale=128:128 "%~dp0%output_dir%/128x128%%~xi"
ffmpeg -loglevel quiet -y -i "%%i" -vf scale=144:144 "%~dp0%output_dir%/144x144%%~xi"
ffmpeg -loglevel quiet -y -i "%%i" -vf scale=152:152 "%~dp0%output_dir%/152x152%%~xi"
ffmpeg -loglevel quiet -y -i "%%i" -vf scale=192:192 "%~dp0%output_dir%/192x192%%~xi"
ffmpeg -loglevel quiet -y -i "%%i" -vf scale=384:384 "%~dp0%output_dir%/384x384%%~xi"
ffmpeg -loglevel quiet -y -i "%%i" -vf scale=512:512 "%~dp0%output_dir%/512x512%%~xi"
)
endlocal
echo.
pause