Skip to content

HEIC images aren't rendered in the UI #1670

Open
Navipro70/bb-plugins
#6

Description

@swairshah

jpg and png images are rendered well but HEIC images when pasted to chat show up in the chat history broken e.g.

Image

Activity

  1. added theissue type on Aug 17, 2026
  2. added
    ui
    on Aug 18, 2026
  3. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1670.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): bb stores and serves pasted HEIC bytes verbatim as a localImage (content-type image/heic) and renders the URL in a plain ; Chromium (web + Electron) has no HEIC decoder and bb never transcodes, so the thumbnail/timeline image is broken — and the provider (Codex) cannot process the image either.
    • Proposed fix: Transcode HEIC/HEIF once at the server upload boundary in storeAttachment (apps/server/src/services/projects/attachments.ts): detect image/heic|heif (or .heic/.heif extension), decode with a WASM libheif package (heic-decode/heic-convert; sharp's prebuilt libvips lacks HEIC), store JPEG (PNG if alpha), return mimeType image/jpeg + new path/sizeBytes, enforce the 10MB limit on output, 400 on decode failure. No wire/protocol change needed. Also render an "unsupported image" tile on onError in AttachmentPreview/ConversationAttachments. Regression test = the repro vitest (upload real HEIC ->…
    • Caveats: Repro run on Linux headless Chromium 145 (same Blink decoders as Electron); macOS Safari would likely render HEIC natively (not tested, no Apple hardware). Claude Code Read-tool behavior with HEIC inferred from code, not run. Worktree was initially at origin/main a108fa7; I checked out 16ceb3a before the live repro and confirmed the relevant files are identical between the two. Repro test file…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  4. added
    confirmed-repro
    on Aug 18, 2026
  5. hypersolid-schalk commented on Sep 14, 2026

    @hypersolid-schalk

    Fresh reproduction and tested implementation against bb 0.43.1 and current main at b9fdeece5de171ea28c5f60566c596617f46ee88.

    Current behavior

    Attaching a valid image/heic file returns HTTP 400:

    HEIC images are not supported. Convert the image to JPEG or PNG before attaching it.
    

    The rejection is currently enforced at the server upload boundary in storeAttachment. JPEG and PNG uploads continue to work.

    Tested implementation

    Prototype branch: https://github.com/hypersolid-schalk/bb/tree/fix/1670-heic-upload

    Commit: hypersolid-schalk@f973a8c

    The implementation:

    • recognizes HEIC/HEIF from normalized MIME type or .heic/.heif extension;
    • enforces the 10 MB image-input limit before decoding;
    • converts the primary image to quality-0.92 JPEG at the server boundary;
    • stores and returns a .jpg localImage with image/jpeg metadata;
    • enforces the 10 MB limit again on converted output;
    • returns a stable 400 response for corrupt HEIC input;
    • updates CLI/guide documentation.

    Verification

    • The changed regression test failed against the old implementation (expected 201, received 400) and passes after the change.
    • Real macOS-generated HEIC bytes upload through the public route and download as a valid 64×64 JPEG.
    • @bb/server and @bb/app typechecks pass.
    • Focused server tests: 4 passed.
    • Focused composer upload tests: 4 passed.
    • @bb/server production build passes.

    The authenticated account hypersolid-schalk is not yet listed in .github/APPROVED_CONTRIBUTORS, so I am publishing the implementation as the requested prototype rather than bypassing the contributor gate. A maintainer approval would allow me to open the PR.

    AGENT GENERATED

  6. added 2 commits that reference this issue on Nov 2, 2026
    157d5cf
    99bf9cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions