anchor.diff:  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"
   )
  -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
  +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%
  -call:echostd " Started  at - %stime%"
  -call:echostd " Finished at - %ftime%"
  +echo. Started  at - %stime%
  +echo. Finished at - %ftime%
   echo.
   echo.-------------------------------------------------------------------------------
   1>&2 call:listerrfiles
  
positive.code: 
  ::%1 - variable name for division (dividend)
  ::%2 - divider
  ::%3 - 10^(number of decimal places) - (100 - 2 decimal places, 1000 - 3 decimal places)
  :division
  set "sign="
  1>nul 2>&1 set /a "int=!%1!/%2"
  
negative.code: call:centerstring errmsg 45
  1>&2 echo. %fn:~,30%^|%errmsg%
  endlocal
  exit /b
  
  ::%1 - variable containing file name
  ::%2 - file name in %1
  ::%3 - max length file name
  :cropfilename
  setlocal  
  set "xfn=%~nx2"
  set "xfnext=%~x2"
  set "xfnlen=0"
  set "xfnextlen=0"
  call:strlen xfn xfnlen
  call:strlen xfnext xfnextlen
  set /a "xfnextlen=%3-%xfnextlen%-2"
  if %xfnlen% gtr %3 (
  	call set "xfn=%%xfn:~,%xfnextlen%%%..%xfnext%"
  ) else (
  	set "xfn=%xfn%                                        "
  	set "xfn=!xfn:~,%3!"
  )
  endlocal & set "%~1=%xfn%"
  exit /b
  
  :centerstring StrVar Length
  