Spaces:
Runtime error
Runtime error
fix share_btn
Browse files- share_btn.py +3 -3
share_btn.py
CHANGED
@@ -28,12 +28,12 @@ share_js = """async () => {
|
|
28 |
const res = await fetch(src);
|
29 |
const blob = await res.blob();
|
30 |
const imgId = Date.now() % 200;
|
31 |
-
const isPng =
|
32 |
if(isPng){
|
33 |
-
const fileName = `controlnet-3d-pose-${
|
34 |
return new File([blob], fileName, { type: 'image/png' });
|
35 |
}else{
|
36 |
-
const fileName = `controlnet-3d-pose-${
|
37 |
return new File([blob], fileName, { type: 'image/jpeg' });
|
38 |
}
|
39 |
}
|
|
|
28 |
const res = await fetch(src);
|
29 |
const blob = await res.blob();
|
30 |
const imgId = Date.now() % 200;
|
31 |
+
const isPng = !!imgEl;
|
32 |
if(isPng){
|
33 |
+
const fileName = `controlnet-3d-pose-${imgId}.png`;
|
34 |
return new File([blob], fileName, { type: 'image/png' });
|
35 |
}else{
|
36 |
+
const fileName = `controlnet-3d-pose-${imgId}.jpg`;
|
37 |
return new File([blob], fileName, { type: 'image/jpeg' });
|
38 |
}
|
39 |
}
|