anchor.diff:  set "countJPG=%tmppath%\countjpg"
   set "countGIF=%tmppath%\countgif"
   set "filelist=%tmppath%\filelist"
  -::For Images with characters
  +::For Images with characters		-	%filelisterr%
  +::For Images are already optimized	-	%filelisterr%1
  +::For Images are not supported		-	%filelisterr%2<num thread>
  +::For Images are not found		-	%filelisterr%3<num thread>
   set "filelisterr=%tmppath%\filerr"
  -::For Images are already optimized
  -set "filelisterr1=%tmppath%\filerr1"
  -::For Images are not supported
  -set "filelisterr2=%tmppath%\filerr2"
  -::For Images are not found
  -set "filelisterr3=%tmppath%\filerr3"
   ::Table size
   set "TFN=29"
  -::restrictions
  -set "BYTECONV=1000000"
  +::restrictions in bytes
  +set "BYTECONV=1000000000"
   
   set "thread=" & set "updatecheck=" & set "outdir=" & set "nooutfolder="
   set "jpegtags=" & set "xtreme=" & set "advanced=" & set "pngtags=" & set "giftags="
  
positive.code: 
  :end
  call:setvtime ftime
  set "fract=0"
  set "changePNG=0" & set "percPNG=0"
  set "changeJPG=0" & set "percJPG=0"
  set "changeGIF=0" & set "percGIF=0"
  if %jpeg% equ 0 if %png% equ 0 if %gif% equ 0 1>nul 2>&1 ping -n 1 -w 500 127.255.255.255 & goto:finmessage
  ::set "TotalNumNOptJPG=0" & set "TotalNumNOptPNG=0" & set "TotalNumNOptGIF=0"
  ::set "stepJPG=0" & set "stepPNG=0" & set "stepGIF=0"
  ::if %thread% gtr 1 (
  ::	for /f "tokens=1-5 delims=;" %%a in ('findstr /e /i /r /c:";ok" "%logfile%png*" ') do call:calcstep PNG %%b %%c
  ::	for /f "tokens=1-5 delims=;" %%a in ('findstr /e /i /r /c:";ok" "%logfile%jpg*" ') do call:calcstep JPG %%b %%c
  ::	for /f "tokens=1-5 delims=;" %%a in ('findstr /e /i /r /c:";ok" "%logfile%gif*" ') do call:calcstep GIF %%b %%c
  ::)
  for /f "tokens=1" %%a in ('findstr /e /i /r /c:";error" "%logfile%png*" 2^>nul ^| find /i /c ";error" 2^>nul') do (
  	set /a "TotalNumErrPNG+=%%a" & set /a "TotalNumPNG-=%%a"
  )
  for /f "tokens=1" %%a in ('findstr /e /i /r /c:";error" "%logfile%jpg*" 2^>nul ^| find /i /c ";error" 2^>nul') do (
  	set /a "TotalNumErrJPG+=%%a" & set /a "TotalNumJPG-=%%a"
  )
  for /f "tokens=1" %%a in ('findstr /e /i /r /c:";error" "%logfile%gif*" 2^>nul ^| find /i /c ";error" 2^>nul') do (
  	set /a "TotalNumErrGIF+=%%a" & set /a "TotalNumGIF-=%%a"
  )
  for /f "tokens=1" %%a in ('findstr /e /i /r /c:";0;0.00;ok" "%logfile%png*" 2^>nul ^| find /i /c ";0;0.00;ok" 2^>nul') do (
  	set /a "TotalNumNOptPNG+=%%a"
  )
  for /f "tokens=1" %%a in ('findstr /e /i /r /c:";0;0.00;ok" "%logfile%jpg*" 2^>nul ^| find /i /c ";0;0.00;ok" 2^>nul') do (
  	set /a "TotalNumNOptJPG+=%%a"
  )
  for /f "tokens=1" %%a in ('findstr /e /i /r /c:";0;0.00;ok" "%logfile%gif*" 2^>nul ^| find /i /c ";0;0.00;ok" 2^>nul') do (
  	set /a "TotalNumNOptGIF+=%%a"
  )
  call:fincalc PNG
  call:fincalc JPG
  call:fincalc GIF
  
  ::set /a "STotalSizePNG+=%TotalSizePNG%/1024"
  ::set /a "SImageSizePNG+=%ImageSizePNG%/1024"
  ::set /a "changePNG=(%ImageSizePNG%-%TotalSizePNG%)" 2>nul
  ::set /a "percPNG=%changePNG%*100/%TotalSizePNG%" 2>nul
  ::set /a "fract=%changePNG%*100%%%TotalSizePNG%*100/%TotalSizePNG%" 2>nul
  ::set /a "percPNG=%percPNG%*100+%fract%" 2>nul
  ::::call:division changePNG 1024 100
  ::call:division percPNG 100 100
  ::set /a "changeJPG=(%ImageSizeJPG%-%TotalSizeJPG%)" 2>nul
  ::set /a "percJPG=%changeJPG%*100/%TotalSizeJPG%" 2>nul
  ::set /a "fract=%changeJPG%*100%%%TotalSizeJPG%*100/%TotalSizeJPG%" 2>nul
  ::set /a "percJPG=%percJPG%*100+%fract%" 2>nul
  ::::call:division changeJPG 1024 100
  ::call:division percJPG 100 100
  ::set /a "changeGIF=(%ImageSizeGIF%-%TotalSizeGIF%)" 2>nul
  ::set /a "percGIF=%changeGIF%*100/%TotalSizeGIF%" 2>nul
  ::set /a "fract=%changeGIF%*100%%%TotalSizeGIF%*100/%TotalSizeGIF%" 2>nul
  ::set /a "percGIF=%percGIF%*100+%fract%" 2>nul
  ::::call:division changeGIF 1024 100
  ::call:division percGIF 100 100
  
  :finmessage
  call:totalmsg PNG %png%
  call:totalmsg JPG %jpeg%
  call:totalmsg GIF %gif%
  echo. Started  at - %stime%
  echo. Finished at - %ftime%
  echo.
  echo.-------------------------------------------------------------------------------
  1>&2 call:listerrfiles
  echo. Image optimization is completed.
  echo.-------------------------------------------------------------------------------
  if /i "%updatecheck%" equ "true" (
  
negative.code: set /a "perc%~1=!change%~1!*100/!STotalSize%~1!" 2>nul
  set /a "fract=!change%~1!*100%%!STotalSize%~1!*100/!STotalSize%~1!" 2>nul
  set /a "perc%~1=!perc%~1!*100+%fract%" 2>nul
  call:division perc%~1 100 100
  exit /b
  
  ::%1 - JPG|PNG|GIF
  ::%2 - Total Size
  ::%3 - Image Size
  :stepcalc
  set /a "TotalSize%~1+=%~2"
  set /a "ImageSize%~1+=%~3"
  if !ImageSize%~1! lss %BYTECONV% if !TotalSize%~1! lss %BYTECONV% exit /b
  set /a "STotalSize%~1+=!TotalSize%~1!/!step%~1!"
  set /a "SImageSize%~1+=!ImageSize%~1!/!step%~1!"
  set "TotalSize%~1=0"
  set "ImageSize%~1=0"
  if !SImageSize%~1! lss %BYTECONV% if !STotalSize%~1! lss %BYTECONV% exit /b
  set /a "STotalSize%~1/=10"
  set /a "SImageSize%~1/=10"
  set /a "step%~1*=10"
  exit /b
  
  :totalmsg
  set /a "tt=!TotalNum%~1!-!TotalNumNOpt%~1!"
  if %tt% equ 0 exit /b
  if not defined isfirst (
  	echo.                                     Total
  	echo.-------------------------------------------------------------------------------
  	set "isfirst=1"
  )
  set "stepcur=!step%~1!"
  set "stepm=1"
  set "F1=%~1                                  "
  set "F5=           !perc%~1!"
  for %%a in (KB KB KB MB MB MB GB GB GB TB TB TB) do (
  	set /a "stepcur/=10"
  	set /a "stepm=stepm*10"
  	if !stepm! equ 1000 set "stepm=1"
  	if !stepcur! equ 1 (
  		set /a "stepm=1000/!stepm!"
  		call:division STotalSize%~1 !stepm! !stepm!
  		call:division SImageSize%~1 !stepm! !stepm!
  		call:division change%~1 !stepm! !stepm!
  		set "F2=           !STotalSize%~1!"
  		set "F3=           !SImageSize%~1!"
  		set "F4=           !change%~1!"
  		echo. !F1:~,%TFN%!^|!F2:~-9!%%~a^|!F3:~-9!%%~a^|!F4:~-8!%%~a^|%F5:~-9%%%
  		exit /b
  ))
  exit /b
  
  :readini
  