Revert "Serve SVG files directly" (#111)

This commit is contained in:
Christian Byrne 2025-05-02 09:47:47 -07:00 committed by GitHub
parent 3850c47fe1
commit e7f241071b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -416,17 +416,6 @@ class PromptServer():
if os.path.isfile(file):
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:
preview_info = request.rel_url.query['preview'].split(';')
image_format = preview_info[0]