From 6cc9630ca5b8cb25a51f653629111bcefecab7d3 Mon Sep 17 00:00:00 2001
From: jamz-uk <222520099+jamz-uk@users.noreply.github.com>
Date: Thu, 21 Aug 2025 22:33:34 +0100
Subject: [PATCH] Update Auto-Image.js
---
Auto-Image.js | 92 ++++++++++++++-------------------------------------
1 file changed, 24 insertions(+), 68 deletions(-)
diff --git a/Auto-Image.js b/Auto-Image.js
index af88484..e882e23 100644
--- a/Auto-Image.js
+++ b/Auto-Image.js
@@ -965,7 +965,6 @@
maxCharges: 1, // Default max charges
cooldown: CONFIG.COOLDOWN_DEFAULT,
imageData: null,
- originalImage: null,
stopFlag: false,
colorsChecked: false,
startPosition: null,
@@ -987,8 +986,10 @@
customTransparencyThreshold: CONFIG.TRANSPARENCY_THRESHOLD,
customWhiteThreshold: CONFIG.WHITE_THRESHOLD,
resizeSettings: null,
+ originalImage: null,
}
+ // Placeholder for the resize preview update function
let _updateResizePreview = () => { };
// --- OVERLAY UPDATE: New OverlayManager class to handle all overlay logic ---
@@ -1984,13 +1985,6 @@
totalPixels: state.imageData.totalPixels,
}
: null,
- originalImage: state.originalImage
- ? {
- width: state.originalImage.width,
- height: state.originalImage.height,
- pixels: Array.from(state.originalImage.pixels),
- }
- : null,
paintedMapPacked: null,
}
@@ -2064,14 +2058,6 @@
}
}
- if (savedData.originalImage) {
- state.originalImage = {
- width: savedData.originalImage.width,
- height: savedData.originalImage.height,
- pixels: new Uint8ClampedArray(savedData.originalImage.pixels),
- };
- }
-
// Prefer packed form if available; fallback to legacy paintedMap array for backward compatibility
if (savedData.paintedMapPacked && savedData.paintedMapPacked.data) {
const { width, height, data } = savedData.paintedMapPacked;
@@ -2110,13 +2096,6 @@
totalPixels: state.imageData.totalPixels,
}
: null,
- originalImage: state.originalImage
- ? {
- width: state.originalImage.width,
- height: state.originalImage.height,
- pixels: Array.from(state.originalImage.pixels),
- }
- : null,
paintedMapPacked: null,
}
@@ -2143,7 +2122,7 @@
} else {
migrated = Utils.migrateProgressToV21(data) || data;
}
- const success = Utils.restoreProgress(migrated)
+ const success = Utils.restoreProgress(migrated)
return success
} catch (error) {
console.error("Error loading from file:", error)
@@ -4203,10 +4182,6 @@
resizeContainer.innerHTML = `
${Utils.t("resizeImage")}
-