thumbnail
This commit is contained in:
@ -60,7 +60,6 @@ def get_image_thumb(store_name: str, y: str, m: str, d: str, db: Session = Depen
|
||||
raise HTTPException(status_code=404, detail="没有找到图片")
|
||||
media_type = mimetypes.guess_type(store_name)[0]
|
||||
img_pil_buffer = BytesIO()
|
||||
print(img_pil.size[1])
|
||||
img_pil.thumbnail((512, img_pil.size[1]))
|
||||
img_pil.save(img_pil_buffer, format=img_pil.format)
|
||||
img_pil.close()
|
||||
|
@ -2,10 +2,12 @@ from sqlalchemy import create_engine
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
SQLALCHEMY_DATABASE_URL = "mysql+pymysql://yukino:yukino169482@120.48.8.98/pics"
|
||||
# SQLALCHEMY_DATABASE_URL = "mysql+pymysql://yukino:yukino169482@120.48.8.98/pics"
|
||||
|
||||
SQLALCHEMY_DATABASE_URL = "sqlite:///C:/Users/quant/Documents/image_db"
|
||||
|
||||
engine = create_engine(SQLALCHEMY_DATABASE_URL)
|
||||
engine = create_engine(SQLALCHEMY_DATABASE_URL, connect_args={
|
||||
'check_same_thread': False})
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
Base = declarative_base()
|
||||
|
Reference in New Issue
Block a user