odysseus-dev/odysseus · error · HTTPException
Unsupported file type: .{ext}
Error message
Unsupported file type: .{ext} What it means
Error "Unsupported file type: .{ext}" thrown in odysseus-dev/odysseus.
Source
Thrown at routes/gallery/gallery_routes.py:395
_dup_q = db.query(GalleryImage).filter(
GalleryImage.file_hash == file_hash,
GalleryImage.is_active == True,
)
if user:
_dup_q = _dup_q.filter(GalleryImage.owner == user)
existing = _dup_q.first()
if existing:
return {"ok": False, "duplicate": True, "filename": existing.filename,
"id": existing.id, "message": "Duplicate photo skipped"}
img_dir = Path(GENERATED_IMAGES_DIR)
img_dir.mkdir(parents=True, exist_ok=True)
ext = file.filename.rsplit(".", 1)[-1].lower() if "." in file.filename else "png"
VIDEO_EXTS = {"mp4", "mov", "webm", "mkv", "m4v"}
IMAGE_EXTS = {"png", "jpg", "jpeg", "webp", "gif"}
if ext not in VIDEO_EXTS and ext not in IMAGE_EXTS:
raise HTTPException(400, f"Unsupported file type: .{ext}")
is_video = ext in VIDEO_EXTS
filename = f"{uuid.uuid4().hex[:12]}.{ext}"
img_path = img_dir / filename
img_path.write_bytes(content)
# Extract EXIF for images only — PIL can't parse video containers
# and the failure path logs a noisy WARNING. We'll add ffprobe-based
# video metadata extraction in a follow-up.
exif = {} if is_video else _extract_exif(content)
original_name = file.filename.rsplit(".", 1)[0] if "." in file.filename else file.filename
img_id = str(uuid.uuid4())
db.add(GalleryImage(
id=img_id,
filename=filename,
prompt=original_name,
model="imported",
owner=user,View on GitHub (pinned to f9235ebbf1)
Solutions
- Upload a file with a supported image extension.
- Convert the file to PNG or JPEG and retry.
When it happens
Trigger: Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.
Common situations: See trigger scenarios.
AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14).
Data as JSON: /api/errors/82d4ed54bef39216.
Report an issue: GitHub.