Skip to content

Commit

Permalink
Support webp upload (#264)
Browse files Browse the repository at this point in the history
Only need to add permissible

- file extension in frontend
- mimetype in backend

Co-authored-by: Ben Bolte <[email protected]>
  • Loading branch information
chennisden and codekansas authored Aug 7, 2024
1 parent 5d5173c commit f370c35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/listing/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion store/app/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit f370c35

Please sign in to comment.