diff --git a/package-lock.json b/package-lock.json index 27e1ec9..3c85203 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "upscayl", - "version": "2.5.0", + "version": "2.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "upscayl", - "version": "2.5.0", + "version": "2.5.1", "license": "AGPL-3.0", "dependencies": { "app-root-dir": "^1.0.2", diff --git a/renderer/components/LeftPaneImageSteps.tsx b/renderer/components/LeftPaneImageSteps.tsx index c8776b6..c9abafc 100644 --- a/renderer/components/LeftPaneImageSteps.tsx +++ b/renderer/components/LeftPaneImageSteps.tsx @@ -104,6 +104,31 @@ function LeftPaneImageSteps({ logit("🔀 Setting model to", currentModel.value); }, [currentModel]); + const getUpscaleResolution = () => { + const newDimensions = { + width: dimensions.width, + height: dimensions.height, + }; + if (doubleUpscayl) { + newDimensions.width = dimensions.width * 16; + newDimensions.height = dimensions.height * 16; + } else { + newDimensions.width = dimensions.width * 4; + newDimensions.height = dimensions.height * 4; + } + + if (newDimensions.width > 32768) { + logit("🚫 Upscale width is too large, setting to a maximum of 32768px"); + newDimensions.width = 32384; + } + if (newDimensions.height > 32768) { + logit("🚫 Upscale height is too large, setting to a maximum of 32768px"); + newDimensions.height = 32384; + } + + return newDimensions; + }; + return (