Please provide the specific Chinese content that needs to be translated so that I can assist you with the translation.
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
@echo off
:: Get the original position parameters
:: for /f "tokens=1,2,3,4,5,6,7" %%a in ('findstr /C:"DeviceRGB" cover.ps') do set jpg=%%a %%b %%c %%d %%e %%f %%g
:: Get the pixel values of the image for judgment
for /f "tokens=2,3" %%h in ('findstr /C:"setcolorspace" cover.ps') do (
if %%h EQU %%i echo The author's photo in the cover does not need to be changed!
if %%h LSS %%i echo The photo is irregular!
if %%h GTR %%i set /a newsize=730*%%h/%%i
)
:::: Get the line number and content of the line
:: for /f "tokens=1,* delims=:" %%m in ('findstr /N /C:"730 730" temp.ps') do (
:: set iLN=%%m
:: set sLine=%%n
::)
::
:: set sLine=%sLine:730 730=!newsize! 730%
::
:: echo %iLn%d> _temp.edl
:: echo i%iLn%>> _temp.edl
:: echo %sLine%>> _temp.edl
:: echo >> _temp.edl
:: echo %iLn%,%iLn%l>> _temp.edl
:: echo e>> _temp.edl
::
:: edlin cover.ps < _temp.edl
:: Write the new size to the specified line
if %newsize% NEQ 0 sed -e "s/\(.*\)730\( 730.*\)/\1%newsize%\2/" cover.ps >cover3.txt
@echo off
setlocal EnableDelayedExpansion
:: Get original positional parameters
for /f "tokens=1,2,3,4,5,6,7" %%a in ('findstr /C:"DeviceRGB" cover.ps') do set jpg=%%a %%b %%c %%d %%e %%f %%g
:: Get pixel values of the image for judgment
for /f "tokens=2,3" %%h in ('findstr /C:"setcolorspace" cover.ps') do (
if %%h EQU %%i echo No need to change the author's photo on the cover!
if %%h LSS %%i echo The photo is irregular!
if %%h GTR %%i set /a newsize=730*%%h/%%i
)
:: Write the new size to the specified line
if %newsize% NEQ 0 sed -e "s/\(.*\)730\( 730.*\)/\1%newsize%\2/" cover.ps >cover3.txt