Skip to content

πŸ†™ Upscayl - #1 Free and Open Source AI Image Upscaler for Linux, MacOS and Windows.

fixed partial image rendering

TGS963d16247d1d99a
diff --git a/electron/utils/convert-and-scale.ts b/electron/utils/convert-and-scale.ts
index cdbcd17..84b051d 100644
--- a/electron/utils/convert-and-scale.ts
+++ b/electron/utils/convert-and-scale.ts
@@ -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;
diff --git a/renderer/pages/index.tsx b/renderer/pages/index.tsx
index f432b29..8ddbb4d 100644
--- a/renderer/pages/index.tsx
+++ b/renderer/pages/index.tsx
@@ -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>
</>