Skip to content

🐛 Internal Error When Reading PNG Files via read_file Tool in Cascade #287

@Empeko

Description

@Empeko

Description

Cascade throws an internal error when attempting to read .png files using the read_file tool or citation format.

Steps to Reproduce

  1. Have a .png file in workspace (e.g., Unity sprite asset)
  2. Use citation format like @path/to/file.png:1 or call read_file tool
  3. Error occurs immediately

Actual Behavior

Invalid argument: an internal error occurred (error ID: e627f23aa1d5490fb70889e9d2e059ee) and crashed cascade

Expected Behavior

  • PNG files should be viewable like JPG/GIF formats
  • OR: Clear error message stating PNG is not supported

Environment

  • OS: Windows 11
  • Windsurf Version: Latest stable
  • Tool: read_file
  • File Type: .png
  • Context: Unity game development project

Impact

  • Severity: Medium-High
  • PNG is the standard format for game development (Unity assets: sprites, textures, UI)
  • Users cannot preview their game assets without manual conversion
  • Workaround exists but is cumbersome and breaks workflow

Current Workaround

Convert PNG → JPG temporarily via PowerShell:

Add-Type -AssemblyName System.Drawing
$img = [System.Drawing.Image]::FromFile("file.png")
$img.Save("temp.jpg", [System.Drawing.Imaging.ImageFormat]::Jpeg)
$img.Dispose()
# Read JPG, then delete temp file

Additional Context
Working formats: .jpg, .gif
Also broken: .bmp (file too large error), .tif (null bytes error)
This significantly impacts game developers using Unity/Unreal/Godot where PNG is the primary asset format
Suggested Fix
Either:

Add PNG support to read_file tool (preferred)
Return user-friendly error message: "PNG format not supported. Please use JPG or GIF."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions