Batch file: Del all "@2x" images.
Posted: 2015-08-06T11:43:41-07:00
This was my first thread:
viewtopic.php?t=28135
HDtoSD all:
Everything works perfect there. Much thanks again for this!
Now i want to got for the other side.
SDtoHD all:
-------------------------------------------------------------------------------
mkdir HDtemp
copy *.png HDtemp
del HDtemp/*.png
mogrify -verbose -format png -resize 200%% HDtemp/*.png
pushd HDtemp
set ext_list=(jpg png gif)
for %%X in %ext_list% do ( [First Trouble: It deletes all files. -> It should just delete the "@2x" elements (example@2x.png -I don´t know how-)
del /Q /S *.%%X
)
setlocal enableDelayedExpansion
for %%a in (*.png) do (
set "filename=%%~nxa"
set "purged_filename=!filename:@2x=!" [Second Troube: It calls "exmaple@2x.png to example.png it should make the ""contrary"".]
ren %%~nxa !purged_filename!
)
endlocal
-------------------------------------------------------------------------------
I know that i will lose some pixels but that doesn´t matter:p
If u don´t know what i actually mean go to the first thread (on the top).
The best way if u just can give me the right "codes" for these 4lines. Would be awesome ty.
For the full exmaple the CONTRARY of that:
http://img5.fotos-hochladen.net/uploads ... rljyvi.png
Much thanks!
MomentumHunt91
viewtopic.php?t=28135
HDtoSD all:
Everything works perfect there. Much thanks again for this!
Now i want to got for the other side.
SDtoHD all:
-------------------------------------------------------------------------------
mkdir HDtemp
copy *.png HDtemp
del HDtemp/*.png
mogrify -verbose -format png -resize 200%% HDtemp/*.png
pushd HDtemp
set ext_list=(jpg png gif)
for %%X in %ext_list% do ( [First Trouble: It deletes all files. -> It should just delete the "@2x" elements (example@2x.png -I don´t know how-)
del /Q /S *.%%X
)
setlocal enableDelayedExpansion
for %%a in (*.png) do (
set "filename=%%~nxa"
set "purged_filename=!filename:@2x=!" [Second Troube: It calls "exmaple@2x.png to example.png it should make the ""contrary"".]
ren %%~nxa !purged_filename!
)
endlocal
-------------------------------------------------------------------------------
I know that i will lose some pixels but that doesn´t matter:p
If u don´t know what i actually mean go to the first thread (on the top).
The best way if u just can give me the right "codes" for these 4lines. Would be awesome ty.
For the full exmaple the CONTRARY of that:
http://img5.fotos-hochladen.net/uploads ... rljyvi.png
Much thanks!
MomentumHunt91