Repository navigation
fix(submissions): decode iPhone HEIC photos instead of failing the response - #145
Conversation
…sponse The contributor form accepts HEIC, but the prebuilt sharp binaries cannot decode HEVC-coded pixels. Every iPhone photo therefore failed the submission with a generic image error. Contributors then retried, reloaded and clicked the error again and again. The image pipeline now decodes HEVC HEIC with libheif's WebAssembly build (heic-decode). It hands the pixels on as a lossless PNG that keeps the photo's own ICC profile, so the master keeps its colour space. AVIF and other formats still go straight to sharp. Image failures that end in the generic 422 are now logged and sent to error tracking, so they are no longer invisible. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 0e71ffef-e903-4230-b773-d9dc0123d940
|
Important Review skippedThis PR was authored by a bot without an assigned CodeRabbit review seat. Ask an organization administrator to assign a seat to the bot. See the seat-assignment guide. After the seat is assigned, request a review again. ⚙️ Run configuration
You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…hunk The libheif WebAssembly bundle now loads only when a HEIC photo arrives. The checksum uses crc32 with a starting value instead of a joined copy. The PNG header offset now has a name, and the comment states only why the code exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 0e71ffef-e903-4230-b773-d9dc0123d940
Select the designated primary image before decoding multi-image HEIC uploads, keeping its dimensions and ICC metadata aligned with the pixels. Preserve alpha for transparent photos and release decoder handles on both success and failure. Add focused primary-photo, transparency, and HEIF rotation fixtures. Use a HEIC upload in the production-image journey and document codec limitations. Validation: bun run verify passes, including 468 unit tests, 48 integration tests, 46 browser tests and the production build. The primary-photo test failed against the original PR implementation. Refs #118, #145. AI-Assisted: true AI-Agent: codex AI-Model: openai/gpt-6.1-sol
|
@coderabbitai review |
|
|
@CodeRabbit help |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
CodeRabbit configuration file (
|
|
@CodeRabbit review |
|
Problem
Contributors could not submit iPhone HEIC photos because Sharp's prebuilt binaries lack an HEVC decoder. The resulting 422 also hid the cause from logs and error tracking.
Origin
signals-scout-generalChanges
HEVC-coded HEIC photos now decode through a lazily loaded WebAssembly codec before entering the existing Sharp pipeline. Multi-image files use their designated primary photo, with its dimensions and ICC profile. Transparent photos keep their alpha channel in PNG masters, and HEIF rotation is applied before producing the master and sRGB WebP preview. Image-processing failures are logged and reported.
The 200 MP guard remains in place before pixel decoding. README documents codec installation and limitations. No deployment configuration changes are required. Decoding runs on the main thread and produces 8-bit pixels; large batches can still reach the existing submission timeout.
Validation
bun run verifypasses locally: formatting, lint, typecheck, 468 unit tests, 48 integration tests, 46 browser tests with 2 intentional skips, build, and deployment checks.bun run smoke:productionpasses locally using the shipped Bun 1.3.9 image. The initial attempt inherited development Clerk keys and failed before upload; the rerun used the smoke fixture defaults.11e4ce2: both push and pull-request runs ofverifyandproduction-imageare green.Review status
Independent full review of
92e3b61...11e4ce2found no blocking or non-blocking findings. No unresolved review threads remain.The PR remains draft because both configured review bots are unavailable for this commit:
No deployment configuration changes are required. Completing the configured bot gate needs the account owners to restore Macroscope credits and assign a CodeRabbit seat, then rerun the reviews.
Refs #118.
Original implementation by Claude Code. Review improvements delivered by GPT-6.1-Sol through the Codex harness in T3 Code.