-
Notifications
You must be signed in to change notification settings - Fork 0
/
pngfat.cmd
61 lines (37 loc) · 949 Bytes
/
pngfat.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@echo off
REM Jump to this directory
pushd "%~dp0"
echo. && echo %cd% && echo.
REM Title
echo PNG Fat && echo.
REM Check if FFmpeg exists
for %%x in (pngcrush.exe) do if not [%%~$PATH:x]==[] goto Initialized
echo Can't find PNG Crush, install PNG Crush then try again, press any key to exit...
echo.
pause > nul
exit /b
:Initialized
REM Check for input directory
if not exist "images" goto MakeImages
:QueryImages
REM Alert user
echo The images directory already exists, do you want to continue?
echo.
set /p m="Enter 'y' for yes or 'n' for no: "
echo.
if %m%==y goto UseImages
if %m%==n exit
REM If neither of the above
goto QueryImages
:MakeImages
mkdir "images"
:UseImages
echo Put the png files in the images folder then press any key to continue...
pause > nul
for %%f in (images\*.png) do (
pngcrush -reduce -brute -ow %%f temp.png
)
echo.
echo Finished. && echo. && echo Press any key to exit...
pause > nul
exit /b