Ashrafb commited on
Commit
c3f2c8d
·
verified ·
1 Parent(s): 0fbc2d1

Update AB/index.html

Browse files
Files changed (1) hide show
  1. AB/index.html +11 -9
AB/index.html CHANGED
@@ -256,17 +256,18 @@ h1 {
256
  }
257
 
258
 
259
- function displayColorizedImage(blob) {
260
- const url = URL.createObjectURL(blob);
261
- const resultContainer = document.getElementById('resultContainer');
262
- resultContainer.innerHTML = `<img src="${url}" alt="Colorized Image" width="400">`;
263
- const downloadLink = document.getElementById('download-link');
264
- downloadLink.href = url;
265
- downloadLink.style.display = 'block';
 
 
266
  }
267
 
268
 
269
-
270
  async function uploadFile() {
271
  const sourceFileInput = document.getElementById('sourceFile');
272
  const resultContainer = document.getElementById('resultContainer');
@@ -302,7 +303,7 @@ h1 {
302
  // If successful response, display the result image
303
  const blob = await response.blob();
304
 
305
- displayColorizedImage(blob);
306
 
307
 
308
  } else {
@@ -331,3 +332,4 @@ h1 {
331
  </script>
332
  </body>
333
  </html>
 
 
256
  }
257
 
258
 
259
+ // Function to display the processed image
260
+ function displayResultImage(url) {
261
+ const resultContainer = document.getElementById('resultContainer');
262
+ // Create an image element
263
+ const img = document.createElement('img');
264
+ // Set the source attribute to the processed image URL
265
+ img.src = url;
266
+ // Append the image element to the result container
267
+ resultContainer.appendChild(img);
268
  }
269
 
270
 
 
271
  async function uploadFile() {
272
  const sourceFileInput = document.getElementById('sourceFile');
273
  const resultContainer = document.getElementById('resultContainer');
 
303
  // If successful response, display the result image
304
  const blob = await response.blob();
305
 
306
+ displayResultImage(url);
307
 
308
 
309
  } else {
 
332
  </script>
333
  </body>
334
  </html>
335
+