Bugfixing

This commit is contained in:
Michal Kváček
2024-01-18 06:53:01 +01:00
parent dabed327dd
commit 3c757df7f1
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -10,8 +10,8 @@ async def resize_photo(path: str, filename: str, photo_id: int):
editor.resize(new_width=2500)
name, _ = os.path.splitext(filename)
editor.write_to_file(quality=85, format_="webp", dest_filename=f"{name}.webp")
editor.write_to_file(quality=85) # toto je potreba pro prvni nacteni nahledu ihned po nahrani, pripadne pro
editor.write_to_file(quality=95, format_="webp", dest_filename=f"{name}.webp")
editor.write_to_file(quality=80) # toto je potreba pro prvni nacteni nahledu ihned po nahrani, pripadne pro
# vygenerovani nahledu (async, muze se delat pred/behem zmensovani fotky -> v tu dobu jeste neexistuje webp)
width, height = editor.img_size
@@ -80,7 +80,7 @@ class PhotoMutationResolver(BaseMutationResolver):
async with get_session() as db:
photo = await self._get_one(db, id, created_by_id=user_id)
flight_id = photo.flight_id
filename = photo.filename
filename = photo.filename+"."+photo.filename_extension
path = get_photo_basepath(flight_id)
return PhotoDetailInfo(
@@ -49,7 +49,7 @@ class CreateEventInput(BaseGraphqlInputType):
pass
@strawberry_sqlalchemy_input(model=models.Event, exclude_fields=["id"])
@strawberry_sqlalchemy_input(model=models.Event, exclude_fields=["id"], all_optional=True)
class EditEventInput(BaseGraphqlInputType):
pass
+1 -1
View File
@@ -35,7 +35,7 @@ async def migrate_photos_to_webp():
await models.Photo.update(session, {
"filename": new_filename,
"cache_key": int(time.time()),
"filename_ext": "webp",
"filename_extension": "webp",
}, obj=photo)
print(path, photo.filename, "=>", new_filename, "OK")
except (Exception, DecompressionBombWarning) as e: