{"record":{"id":"34b122173d8f3dfa","repo":"odysseus-dev/odysseus","slug":"missing-image","errorCode":null,"errorMessage":"Missing image","messagePattern":"Missing image","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":38,"sourceCode":"    GALLERY_UPLOAD_MAX_BYTES,\n    GALLERY_TRANSFORM_UPLOAD_MAX_BYTES,\n)\nfrom src.constants import GENERATED_IMAGES_DIR\nfrom src.optional_deps import patch_realesrgan_torchvision_compat\n\nfrom routes.gallery.gallery_helpers import (\n    GalleryPatch, _extract_exif, _image_to_dict, _owner_filter, _human_size,\n)\n\nlogger = logging.getLogger(__name__)\n\n_SAM_STATE: Dict[str, Any] = {}\n_GROUNDING_STATE: Dict[str, Any] = {}\n\n\ndef _b64_to_pil_image(image_b64: str, *, mode: str = \"RGBA\"):\n    if not image_b64:\n        raise HTTPException(400, \"Missing image\")\n    if \",\" in image_b64 and image_b64.split(\",\", 1)[0].startswith(\"data:\"):\n        image_b64 = image_b64.split(\",\", 1)[1]\n    try:\n        from PIL import Image\n\n        raw = base64.b64decode(image_b64)\n        return Image.open(io.BytesIO(raw)).convert(mode)\n    except HTTPException:\n        raise\n    except Exception as exc:\n        raise HTTPException(400, \"Invalid image\") from exc\n\n\ndef _pil_image_to_b64(img, *, fmt: str = \"PNG\") -> str:\n    buf = io.BytesIO()\n    img.save(buf, format=fmt)\n    return base64.b64encode(buf.getvalue()).decode(\"ascii\")\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L20-L56","documentation":"Error \"Missing image\" 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":["Include an image in the request (base64 or upload id).","Select an image in the editor before running the tool."],"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-15T17:31:12.345Z"}