ironjr commited on
Commit
0f94c08
1 Parent(s): 436ba5c

Update share_btn.py

Browse files
Files changed (1) hide show
  1. share_btn.py +2 -2
share_btn.py CHANGED
@@ -4,7 +4,7 @@ share_js = """async () => {
4
  const response = await fetch(UPLOAD_URL, {
5
  method: 'POST',
6
  headers: {
7
- 'Content-Type': file.type,
8
  'X-Requested-With': 'XMLHttpRequest',
9
  },
10
  body: file, /// <- File inherits from Blob
@@ -48,7 +48,7 @@ share_js = """async () => {
48
  const urls = await Promise.all([...imgEls].map((imgEl) => {
49
  const origURL = imgEl.src;
50
  const imgId = Date.now() % 200;
51
- const fileName = 'stream-multi-diffusion-' + imgId + '.png';
52
  return toDataURL(origURL)
53
  .then(dataUrl => {
54
  return dataURLtoFile(dataUrl, fileName);
 
4
  const response = await fetch(UPLOAD_URL, {
5
  method: 'POST',
6
  headers: {
7
+ 'Content-Type': 'image/webp',
8
  'X-Requested-With': 'XMLHttpRequest',
9
  },
10
  body: file, /// <- File inherits from Blob
 
48
  const urls = await Promise.all([...imgEls].map((imgEl) => {
49
  const origURL = imgEl.src;
50
  const imgId = Date.now() % 200;
51
+ const fileName = 'stream-multi-diffusion-' + imgId + '.webp';
52
  return toDataURL(origURL)
53
  .then(dataUrl => {
54
  return dataURLtoFile(dataUrl, fileName);