[PR #658] [MERGED] Conversion to use ImageSharp rather than System.Drawing.Common #1244

Open
opened 2026-01-29 16:58:51 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ElectronNET/Electron.NET/pull/658
Author: @danatcofo
Created: 1/26/2022
Status: Merged
Merged: 4/6/2022
Merged by: @GregorBiswanger

Base: masterHead: CrossPlatformNativeImage


📝 Commits (1)

  • 86644e7 #637 Conversion to use ImageSharp rather than System.Drawing.Common for cross platform compatibility.

📊 Changes

13 files changed (+185 additions, -154 deletions)

View changed files

📝 ElectronNET.API/ElectronNET.API.csproj (+1 -1)
📝 ElectronNET.API/Entities/AddRepresentationOptions.cs (+1 -1)
📝 ElectronNET.API/Entities/BitmapOptions.cs (+9 -2)
📝 ElectronNET.API/Entities/CreateFromBitmapOptions.cs (+11 -2)
📝 ElectronNET.API/Entities/CreateFromBufferOptions.cs (+9 -1)
ElectronNET.API/Entities/CreateOptions.cs (+24 -0)
ElectronNET.API/Entities/ImageOptions.cs (+13 -0)
📝 ElectronNET.API/Entities/NativeImage.cs (+77 -140)
📝 ElectronNET.API/Entities/NativeImageJsonConverter.cs (+2 -2)
📝 ElectronNET.API/Entities/Size.cs (+12 -0)
📝 ElectronNET.API/Entities/ToBitmapOptions.cs (+9 -2)
📝 ElectronNET.API/Entities/ToDataUrlOptions.cs (+9 -2)
📝 ElectronNET.API/Entities/ToPNGOptions.cs (+8 -1)

📄 Description

fixes #637 Conversion to use ImageSharp rather than System.Drawing.Common for cross platform compatibility.

Breaking Changes:

  • System.Drawing.Common is dropped and SixLabors.ImageSharp is introduced.
  • uses of NativeImage.CreateFromBitmap(bitmap, options); is no longer supported, will cause failed builds.

Unexpected Behaviors:

  • uses ToDataUrl will always create png data urls, unexpected output may happen for those that manipulate this output expecting a different data url format.

Obsoletions:

  • CreateFromBitmapOptions & CreateFromBufferOptions have been consolidated into CreateOptions. Implicit conversions added to ease transition.
  • ToBitmapOptions, ToDataUrlOptions, ToPngOptions & BitmapOptions have been consolidated into ImageOptions. Implicit conversions added to ease transition.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ElectronNET/Electron.NET/pull/658 **Author:** [@danatcofo](https://github.com/danatcofo) **Created:** 1/26/2022 **Status:** ✅ Merged **Merged:** 4/6/2022 **Merged by:** [@GregorBiswanger](https://github.com/GregorBiswanger) **Base:** `master` ← **Head:** `CrossPlatformNativeImage` --- ### 📝 Commits (1) - [`86644e7`](https://github.com/ElectronNET/Electron.NET/commit/86644e736697a70b469659774bc60b1738ed5454) #637 Conversion to use ImageSharp rather than System.Drawing.Common for cross platform compatibility. ### 📊 Changes **13 files changed** (+185 additions, -154 deletions) <details> <summary>View changed files</summary> 📝 `ElectronNET.API/ElectronNET.API.csproj` (+1 -1) 📝 `ElectronNET.API/Entities/AddRepresentationOptions.cs` (+1 -1) 📝 `ElectronNET.API/Entities/BitmapOptions.cs` (+9 -2) 📝 `ElectronNET.API/Entities/CreateFromBitmapOptions.cs` (+11 -2) 📝 `ElectronNET.API/Entities/CreateFromBufferOptions.cs` (+9 -1) ➕ `ElectronNET.API/Entities/CreateOptions.cs` (+24 -0) ➕ `ElectronNET.API/Entities/ImageOptions.cs` (+13 -0) 📝 `ElectronNET.API/Entities/NativeImage.cs` (+77 -140) 📝 `ElectronNET.API/Entities/NativeImageJsonConverter.cs` (+2 -2) 📝 `ElectronNET.API/Entities/Size.cs` (+12 -0) 📝 `ElectronNET.API/Entities/ToBitmapOptions.cs` (+9 -2) 📝 `ElectronNET.API/Entities/ToDataUrlOptions.cs` (+9 -2) 📝 `ElectronNET.API/Entities/ToPNGOptions.cs` (+8 -1) </details> ### 📄 Description fixes #637 Conversion to use ImageSharp rather than System.Drawing.Common for cross platform compatibility. Breaking Changes: * `System.Drawing.Common` is dropped and `SixLabors.ImageSharp` is introduced. * uses of `NativeImage.CreateFromBitmap(bitmap, options);` is no longer supported, will cause failed builds. Unexpected Behaviors: * uses `ToDataUrl` will always create png data urls, unexpected output may happen for those that manipulate this output expecting a different data url format. Obsoletions: * `CreateFromBitmapOptions` & `CreateFromBufferOptions` have been consolidated into `CreateOptions`. Implicit conversions added to ease transition. * `ToBitmapOptions`, `ToDataUrlOptions`, `ToPngOptions` & `BitmapOptions` have been consolidated into `ImageOptions`. Implicit conversions added to ease transition. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 16:58:51 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1244