Wrong media_type sent for JPEG images in VSCode extension

Resolved 💬 3 comments Opened Mar 6, 2026 by boni-brands Closed Mar 10, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When attaching a JPEG image in the chat, the extension sends media_type: "image/png"
instead of image/jpeg, causing API error 400:

"The image was specified using the image/png media type,
but the image appears to be a image/jpeg image"

Steps to reproduce:

  1. Open Claude Code in VSCode
  2. Attach a .jpg image to the chat
  3. Send message

Expected: correct media_type is detected from file content
Actual: media_type is hardcoded as "image/png"

What Should Happen?

When attaching a JPEG image in the chat, the extension sends media_type: "image/png"
instead of image/jpeg, causing API error 400:

"The image was specified using the image/png media type,
but the image appears to be a image/jpeg image"

Steps to reproduce:

  1. Open Claude Code in VSCode
  2. Attach a .jpg image to the chat
  3. Send message

Expected: correct media_type is detected from file content
Actual: media_type is hardcoded as "image/png"

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code in VSCode
  2. Start a new chat
  3. Attach a .jpg (JPEG) image to the message
  4. Send the message

Result: API error 400 - "The image was specified using the image/png
media type, but the image appears to be a image/jpeg image"

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.70

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗