stride3d / stride3d/stride

`Texture.Save` / image encode routes through GDI+ (`System.Drawing`) — throws `PlatformNotSupportedException` on Linux/.NET 7+

Open
#3,321 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Official Release
Version: 4.3.0.2507
Platform(s): Linux (and any non-Windows)

Describe the bug
StandardImageHelper.Windows.cs implements PNG/JPG/BMP save via System.Drawing, which is
Windows-only since .NET 6 (hard PlatformNotSupportedException since .NET 7). Any
Texture.Save(stream, ImageFileType.Png) — screenshots, tooling, tests — is dead on Linux.

To Reproduce

  1. Linux game, texture.Save(stream, ImageFileType.Png)PlatformNotSupportedException.

Expected behavior
Cross-platform image save for at least PNG.

Additional context
Fix shape: a managed encoder path for non-Windows — stb-style single-file encoders
(e.g. StbImageWriteSharp, MIT) avoid heavy dependencies; ImageSharp is not an option post-4.0
license change. We ship StbImageWriteSharp app-side for all captures; happy to PR the same
into StandardImageHelper behind an OS check.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at StandardImageHelper.Windows.cs and trace the Texture.Save(stream, ImageFileType.Png) path to confirm where System.Drawing is used. Compare the app-side StbImageWriteSharp capture path mentioned in the issue, then verify that PNG saving works on Linux without PlatformNotSupportedException; broader JPG/BMP coverage is not specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.