From 4bad13692dcc63b4e742922bd5d045b46607a1a1 Mon Sep 17 00:00:00 2001 From: Emik Date: Sun, 24 May 2026 03:27:28 +0200 Subject: [PATCH] Update upscale.bat --- assets/upscale.bat | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/assets/upscale.bat b/assets/upscale.bat index 4feff88..117e6c5 100644 --- a/assets/upscale.bat +++ b/assets/upscale.bat @@ -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 + ) + ) +) \ No newline at end of file