{"record":{"id":"1ab274ca7e915ca2","repo":"Significant-Gravitas/AutoGPT","slug":"logo-too-large-maximum-logo-max-size-x-logo-max","errorCode":null,"errorMessage":"Logo too large. Maximum {LOGO_MAX_SIZE}x{LOGO_MAX_SIZE}. Got {width}x{height}","messagePattern":"Logo too large\\. Maximum (.+?)x(.+?)\\. Got (.+?)x(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/oauth.py","lineNumber":752,"sourceCode":"    try:\n        image = Image.open(io.BytesIO(file_bytes))\n        width, height = image.size\n\n        if width != height:\n            raise HTTPException(\n                status_code=status.HTTP_400_BAD_REQUEST,\n                detail=f\"Logo must be square. Got {width}x{height}\",\n            )\n\n        if width < LOGO_MIN_SIZE:\n            raise HTTPException(\n                status_code=status.HTTP_400_BAD_REQUEST,\n                detail=f\"Logo too small. Minimum {LOGO_MIN_SIZE}x{LOGO_MIN_SIZE}. \"\n                f\"Got {width}x{height}\",\n            )\n\n        if width > LOGO_MAX_SIZE:\n            raise HTTPException(\n                status_code=status.HTTP_400_BAD_REQUEST,\n                detail=f\"Logo too large. Maximum {LOGO_MAX_SIZE}x{LOGO_MAX_SIZE}. \"\n                f\"Got {width}x{height}\",\n            )\n    except HTTPException:\n        raise\n    except Exception as e:\n        logger.error(f\"Error validating logo image: {e}\")\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail=\"Invalid image file\",\n        )\n\n    # Scan for viruses\n    filename = file.filename or \"logo\"\n    await scan_content_safe(file_bytes, filename=filename)\n\n    # Generate unique filename","sourceCodeStart":734,"sourceCodeEnd":770,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/oauth.py#L734-L770","documentation":"Returned (400) when the square image exceeds LOGO_MAX_SIZE (2048px). The API caps resolution to bound processing and storage cost.","triggerScenarios":"Uploading a 4000x4000 print-quality or raw-camera-derived square image.","commonSituations":"Using print/master brand files directly; camera photos cropped square; scans at high DPI.","solutions":["Resize to 2048x2048 or smaller (1024x1024 is usually plenty for web logos)","Re-export from the design tool at web resolution"],"exampleFix":"# python\nimg = Image.open(\"logo.png\")\n# after\nimg = img.resize((2048, 2048), Image.LANCZOS)\nimg.save(\"logo-web.png\", optimize=True)","handlingStrategy":"validation","validationCode":"MAX = 2048\nif max(Image.open(path).size) > MAX:\n    img = Image.open(path).resize((MAX, MAX), Image.LANCZOS)\n    img.save(path)","typeGuard":"def within_max_size(path: str, maximum: int = 2048) -> bool:\n    return max(Image.open(path).size) <= maximum","tryCatchPattern":"if resp.status_code == 400 and \"too large\" in resp.text and \"Maximum\" in resp.text:\n        resize_and_retry()","preventionTips":["Never feed print-resolution masters to web upload APIs","Resize in the pipeline to 1024-2048px","Watch for this error distinct from the 3MB byte-size error"],"tags":["validation","http-400","image","file-upload"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}