anchor.diff:  	title [Error] %name% %version%
   	if exist "%tmppath%" 1>nul 2>&1 rd /s /q "%tmppath%"
   	1>&2 echo -------------------------------------------------------------------------------
  -	1>&2 echo  Unknown value of parameter %perr%.
  +	1>&2 echo  Unknown value of setting %perr%.
   	call:helpmsg & exit /b
   )
   if "%png%" equ "0" if "%jpeg%" equ "0" if "%gif%" equ "0" goto:endsetcounters
  
positive.code: )
  if %jpeg% equ 1 (
  	mozjpegtran -verbose -revert -optimize -copy all -outfile "%filework%" "%~2" 1>"%jpglog%" 2>&1
  	if errorlevel 1 (call:saverrorlog "%~f2" "The image is not supported" & goto:jpegfileworkerr)
  	for /f "tokens=4,10 delims=:,= " %%a in ('findstr /C:"Start Of Frame" "%jpglog%" 2^>nul') do (set "ep=%%a")
  	if "!ep!" equ "0xc0" goto:jpegfileworkbackup
  	if "!ep!" equ "0xc2" (
  		if /i "%~f2" equ "%~f3" (1>nul 2>&1 move /y "%filework%" "%~f3" || set "errbackup=1")
  		goto:jpegfileworkfinish
  	) else (
  		call:saverrorlog "%~f2" "The image is not supported" & goto:jpegfileworkerr
  	)
  )
  if %jpeg% equ 2 (
  	mozjpegtran -verbose -copy all -outfile "%filework%" "%~2" 1>"%jpglog%" 2>&1
  	if errorlevel 1 (call:saverrorlog "%~f2" "The image is not supported" & goto:jpegfileworkerr)
  	for /f "tokens=4,10 delims=:,= " %%a in ('findstr /C:"Start Of Frame" "%jpglog%" 2^>nul') do (set "ep=%%a")
  	if "!ep!" equ "0xc2" goto:jpegfileworkbackup
  	if "!ep!" equ "0xc0" (
  		if /i "%~f2" equ "%~f3" (1>nul 2>&1 move /y "%filework%" "%~f3" || set "errbackup=1")
  		goto:jpegfileworkfinish
  	) else (
  		call:saverrorlog "%~f2" "The image is not supported" & goto:jpegfileworkerr
  	)
  )
  if %jpeg% equ 3 (
  	jpginfo "%~2" 1>"%jpglog%" 2>&1
  	if errorlevel 1 (call:saverrorlog "%~f2" "The image is not supported" & goto:jpegfileworkerr)
  	for /f "usebackq tokens=5" %%a in ("%jpglog%") do set "ep=%%~a"
  	if /i "!ep!" equ "Baseline" (
  		mozjpegtran -verbose -revert -optimize -copy all -outfile "%filework%" "%~2" 1>nul 2>&1
  		if errorlevel 1 (call:saverrorlog "%~f2" "The image is not supported" & goto:jpegfileworkerr)
  		goto:jpegfileworkbackup
  	)
  	if /i "!ep!" equ "Progressive" (
  		mozjpegtran -verbose -copy all -outfile "%filework%" "%~2" 1>nul 2>&1
  		if errorlevel 1 (call:saverrorlog "%~f2" "The image is not supported" & goto:jpegfileworkerr)
  		goto:jpegfileworkbackup
  	)
  	call:saverrorlog "%~f2" "The image is not supported" & goto:jpegfileworkerr
  )
  
  :jpegfileworkbackup
  if /i "%~f2" neq "%~f3" (
  	call:backup "%filework%" "%~f2" >nul || set "errbackup=1"
  ) else (
  	call:backup "%~f2" "%filework%" true >nul || set "errbackup=1"
  )
  
  :jpegfileworkfinish
  1>nul 2>&1 del /f /q "%jpglog%"
  if %errbackup% neq 0 (call:saverrorlog "%~f2" "The image is not found" & goto:jpegfileworkerr)
  if /i "%metadata%" equ "true" (1>nul 2>&1 jpegstripper -y "%~f3" || (call:saverrorlog "%~f2" "The image is not supported" & exit /b))
  call:savelog "%~f3" %jsize%
  if %thread% equ 1 for %%a in ("%~f3") do (set /a "ImageSizeJPG+=%%~za" & set /a "TotalSizeJPG+=%jsize%")
  exit /b
  
  :jpegfileworkerr
  if /i "%~f2" neq "%~f3" (1>nul 2>&1 del /f /q "%filework%")
  1>nul 2>&1 del /f /q "%jpglog%"
  exit /b 1
  
negative.code: :errormsg
  title [Error] %name% %version%
  if exist "%tmppath%" 1>nul 2>&1 rd /s /q "%tmppath%"
  if "%~1" neq "" echo.%~1
  call:dopause
  exit /b
  