You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
read tool: missing HEIC/HEIF image format support #62767
The read tool does not support the HEIC/HEIF image format, which is the default photo format for iPhones and newer macOS devices. This means users cannot view their iPhone photos using OpenCode without manually converting them first. HEIC should be added to the list of supported image formats.
Environment
opencode version: 2.2.6
OS: Darwin 27.2.0 (darwin arm64)
Terminal: Apple_Terminal (xterm-256color)
Shell: /bin/zsh
Install/channel: latest (npm/br)
Active plugins: None found in config
Reproduction
Take or download a photo on iPhone (saved as .heic by default)
Place the .heic file in any directory
Run: read /path/to/photo.heic
Error returned: "Cannot read binary file"
Expected Behavior
HEIC files should be read and displayed like PNG, JPEG, GIF, and WebP — passed directly to the model's vision capabilities.
HEIC (High Efficiency Image Container) is Apple's default photo format and is extremely common. macOS users who take screenshots or photos with iPhones will frequently encounter HEIC files. The format is standardized (ISO/IEC 23008-12) and widely supported.
Workaround: Users must manually convert HEIC to JPEG/PNG using sips (macOS built-in):
sips -s format jpeg --out output.jpg input.heic
Or use a community skill I created at ~/.config/opencode/skills/heic/SKILL.md that instructs the agent to auto-convert HEIC files before reading.
Implementation suggestion: Use a library like libheif (available via npm as libheif or through macOS native APIs) to decode HEIC before passing the image to the model. The conversion should be transparent to the user.
This is a high-impact, low-effort feature that would significantly improve the experience for iPhone/macOS users.
To restate it: you'd like the read tool (and image attachments) to accept HEIC/HEIF photos by converting them to a format the model accepts, instead of failing with Cannot read binary file.
This isn't a bug. The read tool currently passes only PNG, JPEG, GIF, WebP and PDF to the model, which matches the documented list. Most providers only accept those image formats, so HEIC would need to be converted first. OpenCode already detects HEIC files but has no conversion step yet. I've marked this as a feature request, and maintainers will consider it.
Activity
opencodejr commentedon Nov 8, 2026
Thanks for the detailed request, @darbin!
To restate it: you'd like the
readtool (and image attachments) to accept HEIC/HEIF photos by converting them to a format the model accepts, instead of failing withCannot read binary file.This isn't a bug. The read tool currently passes only PNG, JPEG, GIF, WebP and PDF to the model, which matches the documented list. Most providers only accept those image formats, so HEIC would need to be converted first. OpenCode already detects HEIC files but has no conversion step yet. I've marked this as a feature request, and maintainers will consider it.
Related work:
sharp, thensips, thenffmpeg. It was closed by automated cleanup of old PRs, not rejected.Until then, your
sipsworkaround (or the skill you wrote) is a good way to handle iPhone photos.