openclaw - 💡(How to fix) Fix [Bug/Enhancement] Image size limits too restrictive for modern phone cameras (5MB / 1200px / 6MB) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72193Fetched 2026-04-27 05:33:36
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
closed ×1commented ×1

Fix Action

Fix / Workaround

Current Workaround

The patch is idempotent and survives container restart, but breaks on every npm install -g openclaw.

Code Example

{
  "messages": {
    "image": {
      "maxBytes": 15728640,
      "maxDimensionPx": 1568
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

Three hardcoded constants in the bundled distribution silently drop or aggressively downsize images that are routine for phone cameras:

ConstantBundle fileCurrent valuePractical impact
DEFAULT_IMAGE_MAX_BYTESdist/common-*.js5 * 1024 * 1024 (5 MB)iPhone 14/15 photos, PDF page screenshots get rejected
DEFAULT_IMAGE_MAX_DIMENSION_PXdist/common-*.js1200Phone photos (3024×4032 typical) downsized hard, hurts OCR
MAX_IMAGE_BYTESdist/mime-*.js6 * 1024 * 1024 (6 MB)Same problem at MIME validation layer

For reference, modern provider limits are far higher:

  • Anthropic Messages API: up to 20 MB per image (Claude 3.5+, 4.x)
  • OpenAI: up to 20 MB per image

The current defaults appear to predate the GPT-4-Vision era — modern usage routinely exceeds them.

Current Workaround

Host cron @reboot + */15 runs a sed script bumping everything to:

  • DEFAULT_IMAGE_MAX_BYTES → 15 MB
  • DEFAULT_IMAGE_MAX_DIMENSION_PX → 1568 (Anthropic's recommended max-useful dimension)
  • MAX_IMAGE_BYTES → 15 MB

The patch is idempotent and survives container restart, but breaks on every npm install -g openclaw.

Proposed Solution

Either raise the defaults in source (5/6 MB → 15 MB, 1200 → 1568) or expose them in openclaw.json:

{
  "messages": {
    "image": {
      "maxBytes": 15728640,
      "maxDimensionPx": 1568
    }
  }
}

Environment

  • OpenClaw 2026.4.24 (commit cbcfdf6)
  • Telegram channel
  • Claude Opus 4.x via anthropic-new
  • Constants live in dist/common-*.js and dist/mime-*.js

Thanks for the project!

extent analysis

TL;DR

Update the hardcoded image size constants in the OpenClaw distribution to accommodate larger images from modern phone cameras.

Guidance

  • Review the proposed solution to raise the defaults in source or expose them in openclaw.json for more flexible configuration.
  • Consider the trade-offs between increasing the DEFAULT_IMAGE_MAX_BYTES and DEFAULT_IMAGE_MAX_DIMENSION_PX values, as well as the MAX_IMAGE_BYTES limit.
  • Test the updated configuration with sample images from iPhone 14/15 and PDF page screenshots to ensure they are no longer rejected or aggressively downsized.
  • Evaluate the idempotent sed script used as a current workaround and assess its suitability as a temporary solution until a more permanent fix is implemented.

Example

{
  "messages": {
    "image": {
      "maxBytes": 15728640,
      "maxDimensionPx": 1568
    }
  }
}

This example shows how to expose the image size constants in openclaw.json for more flexible configuration.

Notes

The current workaround using a sed script may not be sustainable in the long term, and updating the defaults in source or exposing them in openclaw.json may be a more robust solution.

Recommendation

Apply the proposed solution to update the hardcoded image size constants, either by raising the defaults in source or exposing them in openclaw.json, to accommodate larger images from modern phone cameras. This will provide a more flexible and sustainable solution than the current workaround.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug/Enhancement] Image size limits too restrictive for modern phone cameras (5MB / 1200px / 6MB) [1 comments, 2 participants]