mirror of
https://github.com/upscayl/upscayl.git
synced 2025-02-21 21:19:31 +01:00
Fix image upscaling
This commit is contained in:
parent
09ec3ff3e6
commit
08303838fb
@ -67,7 +67,7 @@ const imageUpscayl = async (event, payload) => {
|
|||||||
slash +
|
slash +
|
||||||
fileName +
|
fileName +
|
||||||
"_upscayl_" +
|
"_upscayl_" +
|
||||||
desiredScale +
|
(noImageProcessing ? initialScale : desiredScale) +
|
||||||
"x_" +
|
"x_" +
|
||||||
model +
|
model +
|
||||||
"." +
|
"." +
|
||||||
|
@ -5,7 +5,10 @@ import { Tooltip } from "react-tooltip";
|
|||||||
import { themeChange } from "theme-change";
|
import { themeChange } from "theme-change";
|
||||||
import { modelsListAtom } from "../../../atoms/modelsListAtom";
|
import { modelsListAtom } from "../../../atoms/modelsListAtom";
|
||||||
import useLog from "../../hooks/useLog";
|
import useLog from "../../hooks/useLog";
|
||||||
import { scaleAtom } from "../../../atoms/userSettingsAtom";
|
import {
|
||||||
|
noImageProcessingAtom,
|
||||||
|
scaleAtom,
|
||||||
|
} from "../../../atoms/userSettingsAtom";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
progress: string;
|
progress: string;
|
||||||
@ -57,6 +60,7 @@ function LeftPaneImageSteps({
|
|||||||
|
|
||||||
const modelOptions = useAtomValue(modelsListAtom);
|
const modelOptions = useAtomValue(modelsListAtom);
|
||||||
const scale = useAtomValue(scaleAtom);
|
const scale = useAtomValue(scaleAtom);
|
||||||
|
const noImageProcessing = useAtomValue(noImageProcessingAtom);
|
||||||
|
|
||||||
const { logit } = useLog();
|
const { logit } = useLog();
|
||||||
|
|
||||||
@ -112,8 +116,21 @@ function LeftPaneImageSteps({
|
|||||||
height: dimensions.height,
|
height: dimensions.height,
|
||||||
};
|
};
|
||||||
|
|
||||||
const doubleScale = parseInt(scale) * parseInt(scale);
|
let doubleScale = parseInt(scale) * parseInt(scale);
|
||||||
const singleScale = parseInt(scale);
|
let singleScale = parseInt(scale);
|
||||||
|
|
||||||
|
if (noImageProcessing) {
|
||||||
|
let initialScale = 4;
|
||||||
|
if (currentModel.value.includes("x2")) {
|
||||||
|
initialScale = 2;
|
||||||
|
} else if (currentModel.value.includes("x3")) {
|
||||||
|
initialScale = 3;
|
||||||
|
} else {
|
||||||
|
initialScale = 4;
|
||||||
|
}
|
||||||
|
doubleScale = initialScale * initialScale;
|
||||||
|
singleScale = initialScale;
|
||||||
|
}
|
||||||
|
|
||||||
if (doubleUpscayl) {
|
if (doubleUpscayl) {
|
||||||
const newWidth = dimensions.width * doubleScale;
|
const newWidth = dimensions.width * doubleScale;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user