Update static/index.html
Browse files- static/index.html +7 -11
static/index.html
CHANGED
|
@@ -14,16 +14,13 @@
|
|
| 14 |
body: formData
|
| 15 |
});
|
| 16 |
|
| 17 |
-
|
| 18 |
-
const
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
document.getElementById('resultImage').src = imageUrl;
|
| 23 |
-
} else {
|
| 24 |
-
console.error('Failed to process image');
|
| 25 |
}
|
| 26 |
-
}
|
| 27 |
</script>
|
| 28 |
</head>
|
| 29 |
<body>
|
|
@@ -33,7 +30,6 @@
|
|
| 33 |
<input type="submit" value="Upload Image" onclick="uploadImage(event)">
|
| 34 |
</form>
|
| 35 |
|
| 36 |
-
<
|
| 37 |
-
<img id="resultImage" src="" alt="Result Image">
|
| 38 |
</body>
|
| 39 |
</html>
|
|
|
|
| 14 |
body: formData
|
| 15 |
});
|
| 16 |
|
| 17 |
+
const result = await response.blob();
|
| 18 |
+
const imageURL = URL.createObjectURL(result);
|
| 19 |
+
document.getElementById('resultContainer').innerHTML = `<img src="${imageURL}" alt="Result Image">`;
|
| 20 |
+
} catch (error) {
|
| 21 |
+
console.error('Error:', error);
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
| 23 |
+
});
|
| 24 |
</script>
|
| 25 |
</head>
|
| 26 |
<body>
|
|
|
|
| 30 |
<input type="submit" value="Upload Image" onclick="uploadImage(event)">
|
| 31 |
</form>
|
| 32 |
|
| 33 |
+
<div id="resultContainer"></div>
|
|
|
|
| 34 |
</body>
|
| 35 |
</html>
|