mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-04 09:17:12 +08:00
Revert "Serve SVG files directly" (#111)
This commit is contained in:
parent
8daa075737
commit
20539e0be8
11
server.py
11
server.py
@ -417,17 +417,6 @@ class PromptServer():
|
|||||||
|
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
if 'preview' in request.rel_url.query:
|
if 'preview' in request.rel_url.query:
|
||||||
extension = os.path.splitext(filename)[-1]
|
|
||||||
if extension and extension.lower() == ".svg":
|
|
||||||
with open(file, "r") as f:
|
|
||||||
return web.Response(
|
|
||||||
body=f.read(),
|
|
||||||
content_type="image/svg+xml",
|
|
||||||
headers={
|
|
||||||
"Content-Disposition": f'filename="{filename}"'
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
with Image.open(file) as img:
|
with Image.open(file) as img:
|
||||||
preview_info = request.rel_url.query['preview'].split(';')
|
preview_info = request.rel_url.query['preview'].split(';')
|
||||||
image_format = preview_info[0]
|
image_format = preview_info[0]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user