claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Image does not match the provided media type image/png

Open 0anton opened this issue 8 months ago • 1 comments

Image

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [x] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 0.2.103 (Claude Code)
  • Operating System: Ubuntu 22.04 under WSL2 (Windows 11)
  • Terminal: Windows Terminal 1.23.11132.0 (Preview)

Bug Description

Claude Code fails to process image provided in the prompt.

Steps to Reproduce

  1. Paste path to the Claude Code prompt
  2. Hit Enter

Expected Behavior

Image is successfully processed.

Actual Behavior

Claude code fails to process the image.

Additional Context

Tried png and jpg screenshots. Both are normal images made by screenshot capture tool on Windows. Using Claude Code in WSL2 environment.

Example of paths: /mnt/c/Users/user/OneDrive/X_Big_Exchange/Screenshots/Screenshot 2025-05-07 132315.png /mnt/c/Users/user/OneDrive/X_Big_Exchange/Screenshots/ScreenShot446.jpg

Ideas, workarounds?

Error text:

> analyze image [Image #2]
  ⎿ API Error: 400
    {"type":"error","error":{"type":"invalid_request_error","message":"messages.2.content.0.image.source.base64.data: Image does
    not match the provided media type image/png"}}

0anton avatar May 07 '25 11:05 0anton

Thank you for the report, and sorry for the delay. I have a fix in mind.

dicksontsai avatar May 23 '25 14:05 dicksontsai

Sorry for failing to update this particular issue, but we added jpeg support in v1.0.3. (cf similar issue https://github.com/anthropics/claude-code/issues/1265)

dicksontsai avatar May 30 '25 23:05 dicksontsai

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 09 '25 14:08 github-actions[bot]