mirror of
https://github.com/upscayl/upscayl.git
synced 2025-02-17 11:18:36 +01:00
Fix resolution logic
This commit is contained in:
parent
bc63f8533e
commit
d095ded3ff
@ -74,7 +74,6 @@ export const getDoubleUpscaleArguments = ({
|
||||
gpuId ? `-g ${gpuId}` : "",
|
||||
"-f",
|
||||
saveImageAs,
|
||||
customWidth ? `-w ${customWidth}` : "",
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -148,17 +148,28 @@ function LeftPaneImageSteps({
|
||||
let doubleScale = parseInt(scale) * parseInt(scale);
|
||||
let singleScale = parseInt(scale);
|
||||
|
||||
if (useCustomWidth) {
|
||||
}
|
||||
|
||||
if (doubleUpscayl) {
|
||||
const newWidth = dimensions.width * doubleScale;
|
||||
const newHeight = dimensions.height * doubleScale;
|
||||
newDimensions.width = newWidth;
|
||||
newDimensions.height = newHeight;
|
||||
if (useCustomWidth) {
|
||||
newDimensions.width = customWidth;
|
||||
newDimensions.height = Math.round(
|
||||
customWidth * (dimensions.height / dimensions.width),
|
||||
);
|
||||
} else {
|
||||
const newWidth = dimensions.width * doubleScale;
|
||||
const newHeight = dimensions.height * doubleScale;
|
||||
newDimensions.width = newWidth;
|
||||
newDimensions.height = newHeight;
|
||||
}
|
||||
} else {
|
||||
newDimensions.width = dimensions.width * singleScale;
|
||||
newDimensions.height = dimensions.height * singleScale;
|
||||
if (useCustomWidth) {
|
||||
newDimensions.width = customWidth;
|
||||
newDimensions.height = Math.round(
|
||||
customWidth * (dimensions.height / dimensions.width),
|
||||
);
|
||||
} else {
|
||||
newDimensions.width = dimensions.width * singleScale;
|
||||
newDimensions.height = dimensions.height * singleScale;
|
||||
}
|
||||
}
|
||||
|
||||
return newDimensions;
|
||||
|
Loading…
x
Reference in New Issue
Block a user