add option to download images in different formats

This commit is contained in:
raphael
2020-05-20 14:24:33 +02:00
parent eef7c52c7e
commit d804f56152
6 changed files with 37 additions and 8 deletions

View File

@@ -48,6 +48,9 @@
"showSmallestScreenIndicator": {
"type": "boolean"
},
"imageDownloadFormat": {
"type": "string"
},
"performance": {
"type": "object",
"additionalProperties": false,

View File

@@ -26,6 +26,7 @@ function startBackendServer(port) {
console.log("Webserver & socketserver running on port:" + port);
const { accessToken, enableWebdav } = config.backend;
const { imageDownloadFormat } = config.frontend;
app.get("/api/loadwhiteboard", function (req, res) {
var wid = req["query"]["wid"];
@@ -91,7 +92,7 @@ function startBackendServer(port) {
var name = fields["name"] || "";
var date = fields["date"] || +new Date();
var filename = whiteboardId + "_" + date + ".png";
var filename = whiteboardId + "_" + date + "." + imageDownloadFormat;
var webdavaccess = fields["webdavaccess"] || false;
try {
webdavaccess = JSON.parse(webdavaccess);