mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-20 18:08:00 +02:00
Resolved issue mentioned by @JeLuF concerning paths
This commit is contained in:
parent
44082b83fc
commit
3cc951cdaa
@ -8,6 +8,7 @@ from easydiffusion.easydb import crud, models, schemas
|
||||
from easydiffusion.easydb.database import SessionLocal, engine
|
||||
|
||||
from requests.compat import urlparse
|
||||
from os.path import abspath
|
||||
|
||||
import base64, json
|
||||
|
||||
@ -92,7 +93,7 @@ def init():
|
||||
@server_api.get("/image/{image_path:path}")
|
||||
def get_image(image_path: str, db: Session = Depends(get_db)):
|
||||
from easydiffusion.easydb.mappings import Image
|
||||
image_path = image_path.replace("/", "\\")
|
||||
image_path = str(abspath(image_path))
|
||||
amount = len(db.query(Image).filter(Image.path == image_path).all())
|
||||
if amount > 0:
|
||||
image = db.query(Image).filter(Image.path == image_path).first()
|
||||
|
Loading…
x
Reference in New Issue
Block a user