{"record":{"id":"82d4ed54bef39216","repo":"odysseus-dev/odysseus","slug":"unsupported-file-type-ext","errorCode":null,"errorMessage":"Unsupported file type: .{ext}","messagePattern":"Unsupported file type: \\.(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":395,"sourceCode":"            _dup_q = db.query(GalleryImage).filter(\n                GalleryImage.file_hash == file_hash,\n                GalleryImage.is_active == True,\n            )\n            if user:\n                _dup_q = _dup_q.filter(GalleryImage.owner == user)\n            existing = _dup_q.first()\n            if existing:\n                return {\"ok\": False, \"duplicate\": True, \"filename\": existing.filename,\n                        \"id\": existing.id, \"message\": \"Duplicate photo skipped\"}\n\n            img_dir = Path(GENERATED_IMAGES_DIR)\n            img_dir.mkdir(parents=True, exist_ok=True)\n\n            ext = file.filename.rsplit(\".\", 1)[-1].lower() if \".\" in file.filename else \"png\"\n            VIDEO_EXTS = {\"mp4\", \"mov\", \"webm\", \"mkv\", \"m4v\"}\n            IMAGE_EXTS = {\"png\", \"jpg\", \"jpeg\", \"webp\", \"gif\"}\n            if ext not in VIDEO_EXTS and ext not in IMAGE_EXTS:\n                raise HTTPException(400, f\"Unsupported file type: .{ext}\")\n            is_video = ext in VIDEO_EXTS\n            filename = f\"{uuid.uuid4().hex[:12]}.{ext}\"\n            img_path = img_dir / filename\n            img_path.write_bytes(content)\n\n            # Extract EXIF for images only — PIL can't parse video containers\n            # and the failure path logs a noisy WARNING. We'll add ffprobe-based\n            # video metadata extraction in a follow-up.\n            exif = {} if is_video else _extract_exif(content)\n            original_name = file.filename.rsplit(\".\", 1)[0] if \".\" in file.filename else file.filename\n\n            img_id = str(uuid.uuid4())\n            db.add(GalleryImage(\n                id=img_id,\n                filename=filename,\n                prompt=original_name,\n                model=\"imported\",\n                owner=user,","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L377-L413","documentation":"Error \"Unsupported file type: .{ext}\" thrown in odysseus-dev/odysseus.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Upload a file with a supported image extension.","Convert the file to PNG or JPEG and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}