Wrong media_type sent for JPEG images in VSCode extension
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:
- Open Claude Code in VSCode
- Attach a .jpg image to the chat
- 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:
- Open Claude Code in VSCode
- Attach a .jpg image to the chat
- 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
- Open Claude Code in VSCode
- Start a new chat
- Attach a .jpg (JPEG) image to the message
- 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_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗