updates
Browse files- main.py +5 -3
- static/index.html +3 -3
main.py
CHANGED
@@ -97,16 +97,18 @@ def verify_image(fileUpload: UploadFile):
|
|
97 |
|
98 |
c2pa_string = str(response_list[0])
|
99 |
c2pa = c2pa_string.split(":", 1)
|
|
|
100 |
|
101 |
watermark_string = str(response_list[1])
|
102 |
watermark = watermark_string.split(":", 1)
|
|
|
103 |
|
104 |
original_media_string = str(response_list[2])
|
105 |
original_media = original_media_string.split(":", 1)
|
106 |
-
original_media =
|
107 |
-
|
108 |
|
109 |
-
return {"response": fileUpload.filename, "contains_c2pa" : c2pa
|
110 |
|
111 |
|
112 |
|
|
|
97 |
|
98 |
c2pa_string = str(response_list[0])
|
99 |
c2pa = c2pa_string.split(":", 1)
|
100 |
+
c2pa = c2pa[1].translate(None, " '")
|
101 |
|
102 |
watermark_string = str(response_list[1])
|
103 |
watermark = watermark_string.split(":", 1)
|
104 |
+
watermark = watermark[1].translate(None, " '")
|
105 |
|
106 |
original_media_string = str(response_list[2])
|
107 |
original_media = original_media_string.split(":", 1)
|
108 |
+
original_media = original_media[1].translate(None, " '")
|
109 |
+
|
110 |
|
111 |
+
return {"response": fileUpload.filename, "contains_c2pa" : c2pa, "contains_watermark" : watermark, "original_media" : original_media}
|
112 |
|
113 |
|
114 |
|
static/index.html
CHANGED
@@ -194,6 +194,8 @@
|
|
194 |
const spinner = document.getElementById("spinner");
|
195 |
const imagePrompt = document.getElementById("prompt");
|
196 |
const model = document.getElementById("model");
|
|
|
|
|
197 |
|
198 |
generateTab.addEventListener("click", (event) => {
|
199 |
event.target.classList.add("active");
|
@@ -312,8 +314,6 @@
|
|
312 |
const resp = await generateImage(imagePrompt.value, model.value);
|
313 |
const path = "/" + resp;
|
314 |
|
315 |
-
var resultsContainer = document.getElementById("image-container");
|
316 |
-
|
317 |
var truepicDisplay = document.createElement("truepic-display");
|
318 |
/*
|
319 |
truepicDisplay.addEventListener(
|
@@ -334,7 +334,7 @@
|
|
334 |
truepicDisplay.appendChild(truepic);
|
335 |
|
336 |
spinner.style.display = "none";
|
337 |
-
|
338 |
|
339 |
/*
|
340 |
downloadLink.style.display = "block";
|
|
|
194 |
const spinner = document.getElementById("spinner");
|
195 |
const imagePrompt = document.getElementById("prompt");
|
196 |
const model = document.getElementById("model");
|
197 |
+
const generateImageContainer = document.querySelector(".display-generate .image-container");
|
198 |
+
|
199 |
|
200 |
generateTab.addEventListener("click", (event) => {
|
201 |
event.target.classList.add("active");
|
|
|
314 |
const resp = await generateImage(imagePrompt.value, model.value);
|
315 |
const path = "/" + resp;
|
316 |
|
|
|
|
|
317 |
var truepicDisplay = document.createElement("truepic-display");
|
318 |
/*
|
319 |
truepicDisplay.addEventListener(
|
|
|
334 |
truepicDisplay.appendChild(truepic);
|
335 |
|
336 |
spinner.style.display = "none";
|
337 |
+
generateImageContainer.appendChild(truepicDisplay);
|
338 |
|
339 |
/*
|
340 |
downloadLink.style.display = "block";
|