Skip to content

fix: accept 24 MP camera photographs - #13

Closed
TorstenDittmann wants to merge 1 commit into
mainfrom
torsten/accept-high-res-production-photos-dc91
Closed

TorstenDittmann wants to merge 1 commit into
mainfrom
torsten/accept-high-res-production-photos-dc91

Conversation

@TorstenDittmann

Copy link
Copy Markdown
Contributor

Problem

A production 6000×4000 PNG (~28 MiB, 24 megapixels) could not be analyzed. The request was rejected before inference:

  1. 10 MiB upload cap — the PNG is 26.7 MiB, so /analyze returned 413.
  2. 20 megapixel decode ceiling — 6000×4000 is 24 MP, so decode would also 413 even if the body were smaller.

The image itself decodes cleanly; the limits were the only failure.

Change

  • Raise the request limit from 10 MiB to 32 MiB (covers this photograph with headroom).
  • Restore the decode ceiling from 20 MP to 40 MP, which was the original value and still rejects decompression bombs.
  • Lock the production dimensions (6000×4000, 28,026,017 bytes) into unit tests, and document the new limits in the README and docs site.

The original photograph is not redistributed.

Open in Web Open in Cursor 

A 6000x4000 PNG (~28 MiB, 24 MP) was rejected by the 10 MiB upload cap
and the 20 megapixel decode ceiling. Raise those limits to 32 MiB and
40 megapixels so common camera photos can be analyzed.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
@appwrite

appwrite Bot commented Sep 14, 2026

Copy link
Copy Markdown

Autogravity

Project ID: 6a9e5d640016fa6fb653

Sites (1)
Site Status Logs Preview QR
 Docs
autogravity-docs
Ready Ready View Logs Preview URL QR Code

Tip

SSR frameworks are fully supported with configurable build runtimes

@TorstenDittmann
TorstenDittmann marked this pull request as ready for review September 14, 2026 18:52
@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The runtime limit changes appear sound, but the explicit repository testing requirement must be satisfied before merging by replacing the implementation-coupled checks with a valid end-to-end behavioral regression.

Fix All in Claude CodeFindings

  1. P2 Implementation-Coupled Regression Tests
Fix with agent prompt
### Issue 1
cmd/autogravity/main_test.go:324-337
`TestProductionPhotographFitsLimits` only compares duplicated dimensions and byte counts with `maxRequestBytes` and `imageutil.MaxPixels`. The related header-only test also requires decoding to fail, and the existing valid fixtures are all small. As a result, these tests can remain green even if a valid 6000×4000 image cannot be decoded or accepted by the handler. This violates the repository directive to test observable behavior rather than mirror source configuration. Replace these checks with a valid generated or fixture image that exercises successful decoding or handler acceptance; this repository requirement must be satisfied before merging.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

  • The runtime and documented limits are aligned.
  • Request and decode admission remain concurrency-bounded.
  • The new production-photograph tests mirror implementation limits rather than proving successful behavior with a valid image.

Reviews (1) · Last reviewed commit: "fix: accept 24 MP camera photographs in ..."

Comment on lines +324 to +337
func TestProductionPhotographFitsLimits(t *testing.T) {
const (
productionPNGBytes = 28_026_017
productionWidth = 6000
productionHeight = 4000
)
if maxRequestBytes < productionPNGBytes {
t.Fatalf("maxRequestBytes = %d, production photograph is %d bytes", maxRequestBytes, productionPNGBytes)
}
pixels := int64(productionWidth) * int64(productionHeight)
if pixels > imageutil.MaxPixels {
t.Fatalf("MaxPixels = %d, production photograph is %d pixels", imageutil.MaxPixels, pixels)
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Implementation-Coupled Regression Tests

TestProductionPhotographFitsLimits only compares duplicated dimensions and byte counts with maxRequestBytes and imageutil.MaxPixels. The related header-only test also requires decoding to fail, and the existing valid fixtures are all small. As a result, these tests can remain green even if a valid 6000×4000 image cannot be decoded or accepted by the handler. This violates the repository directive to test observable behavior rather than mirror source configuration. Replace these checks with a valid generated or fixture image that exercises successful decoding or handler acceptance; this repository requirement must be satisfied before merging.

Context Used: Call out and harshly judge implementation-coupled tests. We don't mirror source code, configuration, or version pins in assertions. We test observable behavior; use linters for syntax and schema checks. (source)

Knowledge Base Used: CLI integration and evaluation

Prompt To Fix With AI
This is a comment left during a code review.
Path: cmd/autogravity/main_test.go
Line: 324-337

Comment:
**Implementation-Coupled Regression Tests**

`TestProductionPhotographFitsLimits` only compares duplicated dimensions and byte counts with `maxRequestBytes` and `imageutil.MaxPixels`. The related header-only test also requires decoding to fail, and the existing valid fixtures are all small. As a result, these tests can remain green even if a valid 6000×4000 image cannot be decoded or accepted by the handler. This violates the repository directive to test observable behavior rather than mirror source configuration. Replace these checks with a valid generated or fixture image that exercises successful decoding or handler acceptance; this repository requirement must be satisfied before merging.

**Context Used:** Call out and harshly judge implementation-coupled tests. We don't mirror source code, configuration, or version pins in assertions. We test observable behavior; use linters for syntax and schema checks. ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))

**Knowledge Base Used:** [CLI integration and evaluation](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/appwrite/autogravity/-/docs/cli-validation.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants