From 6e0cf9a34d3de946c20e21fe6494815da2c08ef8 Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Wed, 28 Oct 2026 21:33:14 +0900 Subject: [PATCH] fix: do not upscale small images in tools/resize.ps1 --- tools/resize.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/resize.ps1 b/tools/resize.ps1 index 105b2d5..e9b936e 100644 --- a/tools/resize.ps1 +++ b/tools/resize.ps1 @@ -40,8 +40,8 @@ if ($image.PropertyIdList -contains $orientationTag) { } } -# Same as sips -Z 800: fit the longest side to 800px, upscaling smaller images too. -$scale = 800 / [Math]::Max($image.Width, $image.Height) +# Fit the longest side to 800px, like resize.swift. Smaller images are not upscaled. +$scale = [Math]::Min(1.0, 800 / [Math]::Max($image.Width, $image.Height)) $width = [int][Math]::Round($image.Width * $scale) $height = [int][Math]::Round($image.Height * $scale)