Skip to content
Closed

Dev #263

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/app/services/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import aiofiles
import aiofiles.os
import sentry_sdk
from PIL import Image, ImageOps
from database.pg.file_ops.file_crud import (
create_db_folder,
get_file_by_id,
get_root_folder_for_user,
update_file_hash,
)
from database.pg.models import Files
from PIL import Image, ImageOps
from sqlalchemy.ext.asyncio import AsyncEngine as SQLAlchemyAsyncEngine

USER_FILES_BASE_DIR = "data/user_files"
Expand Down Expand Up @@ -201,7 +201,8 @@ def _resize_image_sync(source_path: str, target_path: str, width: int, height: i
if ext in [".jpg", ".jpeg"] and resized_img.mode in ("RGBA", "P"):
resized_img = resized_img.convert("RGB")

resized_img.save(temp_path, optimize=True)
img_format = Image.registered_extensions().get(ext)
resized_img.save(temp_path, format=img_format, optimize=True)

os.replace(temp_path, target_path)
except Exception as e:
Expand Down
Binary file added docs/imgs/github-social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/imgs/key-features-input-nodes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/imgs/main-canvas-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/imgs/main-chat-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/imgs/readme_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading