diff --git a/remote-server/control-panel/index.html b/remote-server/control-panel/index.html
index 2aa2f7ec..79af3cd6 100644
--- a/remote-server/control-panel/index.html
+++ b/remote-server/control-panel/index.html
@@ -173,6 +173,10 @@
if (prefix === "server__" && key === "protocol"){
toggle_server_protocol(value);
}
+ // Special processing is needed for the resolution selector (height is the discriminant0)
+ if (prefix === "image__" && key === "height"){
+ document.getElementById("resolution_selector").value = value;
+ }
// Special processing is needed for the overlay type radio switch
prefixes = prefix.split("__");
if (prefixes[0] === "overlays" && key === "type"){
@@ -230,7 +234,12 @@
// Fields that are hidden should not be processed
// but radios might be hidden by CSS to make the button style
- if (!field.offsetParent && field.type !== "radio") { return; }
+ if (!field.offsetParent &&
+ field.type !== "radio" &&
+ field.name !== "image__width" &&
+ field.name !== "image__height") {
+ return;
+ }
// Empty strings are null
if (value===""){ value = null; }
@@ -499,8 +508,6 @@
return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
}
-
-
@@ -678,41 +685,34 @@
Foto:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
@@ -740,6 +740,28 @@
Foto:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Per aggiungere data e ora nella foto, seleziona "Testo" nella posizione desiderata e
+ usa %%TIME per indicare l'ora, %%DATE per indicare la data.
+ Per esempio, se nel testo scrivi "Data di oggi: %%DATE", sull'immagine vedrai
+ qualcosa di simile a "Data di oggi: 01-01-2020"
+
+
+
+
@@ -1494,6 +1516,15 @@
In basso a sinistra
});
});
})
+
+ // Resolution selector listener
+ document.getElementById("resolution_selector").onchange = function(event){
+ var width = event.target.options[event.target.selectedIndex].dataset.width;
+ var height = event.target.options[event.target.selectedIndex].dataset.height;
+ document.getElementById('image__width').value = width;
+ document.getElementById('image__height').value = height;
+ };
+
// Hooks on the Save button click event to trigger the save operation
form.onsubmit = async (e) => {
diff --git a/webcam/webcam/constants.py b/webcam/webcam/constants.py
index 614da860..b754ce38 100644
--- a/webcam/webcam/constants.py
+++ b/webcam/webcam/constants.py
@@ -7,7 +7,7 @@
CONFIGURATION_BACKUP_PATH = PATH / "configuration.json.bak"
IMAGE_OVERLAYS_PATH = PATH / "overlays"
-REMOTE_IMAGES_PATH = "pannello/config/images/"
+REMOTE_IMAGES_PATH = "configuration/overlays/"
LOGS_PATH = PATH/ "logs.txt"
diff --git a/webcam/webcam/server.py b/webcam/webcam/server.py
index dd1f5da2..f7cec510 100644
--- a/webcam/webcam/server.py
+++ b/webcam/webcam/server.py
@@ -243,7 +243,7 @@ def download_overlay_image(self, image_name: str) -> None:
else:
log_error(f"New overlay image failed to download: {image_name}")
log(f"Response status code: {r.status_code}")
- raise ValueError("Overlay image failed to download: {image_name}")
+ raise ValueError(f"Overlay image failed to download: {image_name}")
def send_logs(self, path: Path):
@@ -411,7 +411,7 @@ def download_overlay_image(self, image_name: str) -> None:
# NOTE: Errors here can escalate
with open(IMAGE_OVERLAYS_PATH / image_name ,'wb') as overlay:
response = self._ftp_client.retrbinary(
- f"RETR configuration/overlays/{image_name}", overlay.write)
+ f"RETR {REMOTE_IMAGES_PATH}{image_name}", overlay.write)
if not "226" in response:
raise ValueError(f"The server replied with an error code for {image_name}: " + response)
log(f"New overlay image downloaded: {image_name}")