Skip to content

[FEATURE] Auto-convert HEIC/HEIF attachments to JPEG instead of rejecting them (VS Code extension) #76492

Description

@suhasbhat111

Problem

iPhone photos default to HEIC. Dragging one into the Claude Code panel in VS Code shows:

Unsupported file type: IMG_XXXX.HEIC. Supported types: images (PNG, JPG, GIF, WebP), text files, and PDFs.

For anyone whose photos come from an iPhone — i.e., most Mac users — this is constant
friction: every photo needs a manual conversion step before Claude can see it.

Why the current rejection exists (and why this request is different)

The webview's allowlist (image/jpeg, image/png, image/gif, image/webp) mirrors
what the Messages API accepts, and #57323 showed what happens when HEIC bytes sneak
past the sniff: a 400 that poisons session history. So rejecting HEIC as-is is
correct — this request is not "allowlist HEIC," it's transcode it client-side
before it enters the message.

Proposed solution

When an attached/pasted file is HEIC/HEIF, convert to JPEG before building the
image content block:

  1. macOS (the platform where HEIC actually occurs): the extension host can shell
    out to the built-in sips -s format jpeg <file> — zero new dependencies,
    milliseconds per photo. The webview can't do it itself (Chromium has no HEIC
    decoder), but it already talks to the extension host, which has fs/process access.
  2. Cross-platform fallback (optional): a wasm decoder (e.g. libheif) in the
    extension host.
  3. During transcode, bake in EXIF orientation — [BUG] Image perception incorrectly renders HEIC-converted JPEGs as upside down #22598 reports HEIC-converted JPEGs
    rendering upside down, so orientation handling should ship with this.

Workaround today (for others who land here)

Don't attach the file — mention its path (or just its filename) in the prompt and let
Claude convert it with sips and Read the JPEG. Works reliably, but drag-and-drop is
the natural gesture, and the error text sends users hunting for converters instead.

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions