Ashrafb commited on
Commit
61c4736
·
verified ·
1 Parent(s): 9efc85e

Update static/index.html

Browse files
Files changed (1) hide show
  1. static/index.html +7 -11
static/index.html CHANGED
@@ -14,16 +14,13 @@
14
  body: formData
15
  });
16
 
17
- if (response.ok) {
18
- const resultImage = await response.blob();
19
- const imageUrl = URL.createObjectURL(resultImage);
20
-
21
- // Display the result image
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
- <h2>Result Image</h2>
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>