1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-09-24 11:28:25 +02:00

fixed partial image rendering

This commit is contained in:
TGS963 2023-09-13 21:45:42 +05:30
parent 38e39243a4
commit d16247d1d9
2 changed files with 15 additions and 13 deletions

View File

@ -33,15 +33,14 @@ const convertAndScale = async (
}
// Save the image
const buffer = await newImage.toBuffer();
sharp(buffer)
.toFile(processedImagePath)
.then(() => {
logit("✅ Done converting to: ", upscaledImagePath);
})
.catch((error) => {
logit("❌ Error converting to: ", saveImageAs, error);
onError(error);
});
try {
await sharp(buffer).toFile(processedImagePath);
} catch (error) {
logit("❌ Error converting to: ", saveImageAs, error);
onError(error);
}
logit("✅ Done converting to: ", upscaledImagePath);
};
export default convertAndScale;

View File

@ -146,7 +146,7 @@ const Home = () => {
// UPSCAYL DONE
window.electron.on(COMMAND.UPSCAYL_DONE, (_, data: string) => {
setProgress("");
setTimeout(() => setUpscaledImagePath(data), 500);
setUpscaledImagePath(data);
logit("upscaledImagePath: ", data);
logit(`💯 UPSCAYL_DONE: `, data);
});
@ -499,7 +499,8 @@ const Home = () => {
className="mb-5 rounded-btn p-1 mx-5 bg-success shadow-lg shadow-success/40 text-slate-50 animate-pulse text-sm"
onClick={() => {
setShowCloudModal(true);
}}>
}}
>
Introducing Upscayl Cloud
</button>
)}
@ -557,7 +558,8 @@ const Home = () => {
onDragOver={(e) => handleDragOver(e)}
onDragEnter={(e) => handleDragEnter(e)}
onDragLeave={(e) => handleDragLeave(e)}
onPaste={(e) => handlePaste(e)}>
onPaste={(e) => handlePaste(e)}
>
{window.electron.platform === "mac" && (
<div className="absolute top-0 w-full h-8 mac-titlebar"></div>
)}
@ -627,7 +629,8 @@ const Home = () => {
</p>
<button
className="btn btn-primary bg-gradient-blue rounded-btn p-3 font-medium text-white/90 transition-colors"
onClick={openFolderHandler}>
onClick={openFolderHandler}
>
Open Upscayled Folder
</button>
</>