Skip to content

Compress photo captures so they fit the 7MB upload cap - #267

Open
jasonvanwyk wants to merge 1 commit into
Grashjs:mainfrom
jasonvanwyk:fix/compress-photo-captures
Open

Compress photo captures so they fit the 7MB upload cap#267
jasonvanwyk wants to merge 1 commit into
Grashjs:mainfrom
jasonvanwyk:fix/compress-photo-captures

Conversation

@jasonvanwyk

Copy link
Copy Markdown

Problem

InAppCamera.tsx calls takePictureAsync({ quality: 1 }) and FileUpload.tsx opens the gallery picker with quality: 1 — both uncompressed. Modern phone cameras (12–200MP) produce 8–15MB JPEGs at that setting, and FileUpload.tsx's maxFileSize = 7 check then rejects them:

"The file size should not be more than 7 MB"

Net effect: on many current devices it is impossible to attach a photo taken with the phone — every capture fails the size check. Reproduced on a Samsung Galaxy A-series taking a work-order image.

Fix

Request quality: 0.5 from both the in-app camera and the gallery picker. A 12MP capture re-encodes to roughly 2–4MB — comfortably under the existing cap, with no visible quality loss for maintenance-evidence photos. The 7MB check is kept as a backstop.

Test plan

  • Take a photo with the in-app camera on a modern phone → attaches successfully instead of erroring
  • Pick a photo from the gallery → compressed on selection, attaches successfully
  • Existing size check still rejects oversized files (e.g. a >14MB source that stays >7MB after re-encode)

🤖 Generated with Claude Code

https://claude.ai/code/session_01EyvTUatQCeaxXTA33qKQ4q

The in-app camera and gallery picker both request quality 1
(uncompressed), so modern phone cameras produce 8-15MB JPEGs that
FileUpload's 7MB size check then rejects — users cannot attach a photo
taken with the phone at all. Quality 0.5 re-encodes a 12MP capture to
roughly 2-4MB.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EyvTUatQCeaxXTA33qKQ4q
@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

👷 Deploy request for atlasjs-home pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 45508da

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.

1 participant