Ashrafb commited on
Commit
b091539
·
verified ·
1 Parent(s): 8c7c5f7

Update static/index.html

Browse files
Files changed (1) hide show
  1. static/index.html +5 -2
static/index.html CHANGED
@@ -256,7 +256,7 @@ input[type="color"]:focus {
256
  loadingIndicator.style.display = 'inline'; // Show loading indicator
257
 
258
  try {
259
- const response = await fetch('/process-image/', {
260
  method: 'POST',
261
  body: formData
262
  });
@@ -266,10 +266,13 @@ input[type="color"]:focus {
266
  }
267
 
268
  const blob = await response.blob();
269
- const originalImageDataUrl = URL.createObjectURL(blob);
270
  document.getElementById('outputImage').src = originalImageDataUrl;
271
  document.getElementById('outputImage').style.display = 'inline';
272
  loadingIndicator.style.display = 'none'; // Hide loading indicator once processing is complete
 
 
 
273
  } catch (error) {
274
  console.error('Error:', error);
275
  loadingIndicator.style.display = 'none'; // Hide loading indicator in case of error
 
256
  loadingIndicator.style.display = 'inline'; // Show loading indicator
257
 
258
  try {
259
+ const response = await fetch('https://ashrafb-brcb2.hf.space/process-image/', {
260
  method: 'POST',
261
  body: formData
262
  });
 
266
  }
267
 
268
  const blob = await response.blob();
269
+ originalImageDataUrl = URL.createObjectURL(blob); // Update originalImageDataUrl
270
  document.getElementById('outputImage').src = originalImageDataUrl;
271
  document.getElementById('outputImage').style.display = 'inline';
272
  loadingIndicator.style.display = 'none'; // Hide loading indicator once processing is complete
273
+
274
+ // Call applyBackground function with the processed image data URL
275
+ applyBackground(originalImageDataUrl);
276
  } catch (error) {
277
  console.error('Error:', error);
278
  loadingIndicator.style.display = 'none'; // Hide loading indicator in case of error