Update upscale.bat

This commit is contained in:
Emik 2026-05-24 03:27:28 +02:00
parent 2fd567dd27
commit 4bad13692d
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF

View file

@ -1 +1,18 @@
for /F %%x in ('dir /B/D 1x') do magick 1x\%%x -scale 200%% 2x\%%x
@echo off
for /F %%x in ('dir /B/D 2x') do (
if %%~xx == .png (
if not exist 1x\%%x (
echo Removing deleted file 1x\%%x from 2x\
del 2x\%%x
)
)
)
for /F %%x in ('dir /B/D 1x') do (
if %%~xx == .png (
REM https://stackoverflow.com/questions/1687014/how-do-i-compare-timestamps-of-files-in-a-batch-script/58323817#58323817
xcopy /LDY /-I 1x\%%x 2x\%%x | findstr /B /C:"1 " > nul 2>&1 && (
echo Updating changed file 1x\%%x in 2x\
magick 1x\%%x -filter point -resize 200%% 2x\%%x
)
)
)