From f370c35d9db89b3757a74b79440bbc7db7424ba5 Mon Sep 17 00:00:00 2001 From: Dennis Chen <41879777+chennisden@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:46:33 -0700 Subject: [PATCH] Support webp upload (#264) Only need to add permissible - file extension in frontend - mimetype in backend Co-authored-by: Ben Bolte --- frontend/src/components/listing/FileUpload.tsx | 2 +- store/app/model.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/listing/FileUpload.tsx b/frontend/src/components/listing/FileUpload.tsx index d70d976f..75755527 100644 --- a/frontend/src/components/listing/FileUpload.tsx +++ b/frontend/src/components/listing/FileUpload.tsx @@ -79,7 +79,7 @@ export const FileUploader = forwardRef< const [activeIndex, setActiveIndex] = useState(-1); const { accept = { - "image/*": [".jpg", ".jpeg", ".png", ".gif"], + "image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp"], "application/xm": [".urdf"], }, maxFiles = 1, diff --git a/store/app/model.py b/store/app/model.py index a0056491..5f77ecd0 100644 --- a/store/app/model.py +++ b/store/app/model.py @@ -117,7 +117,7 @@ def create(cls, user_id: str, source: APIKeySource, permissions: APIKeyPermissio UPLOAD_CONTENT_TYPE_OPTIONS: dict[ArtifactType, set[str]] = { # Image - "image": {"image/png", "image/jpeg", "image/jpg"}, + "image": {"image/png", "image/jpeg", "image/jpg", "image/gif", "image/webp"}, # XML "urdf": {"application/xml"}, "mjcf": {"application/xml"},