Skip to content

Commit 9b0e6c1

Browse files
authored
Fix release CI warnings (#6)
Add XML documentation for the image converter APIs reported by CI. Suppress CS1591 during generated XML documentation builds so existing undocumented public APIs do not flood release builds. Pin Windows GitHub Actions jobs to windows-2022 to avoid the upcoming windows-latest image migration notice.
1 parent 68bda31 commit 9b0e6c1

5 files changed

Lines changed: 252 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
build:
20-
runs-on: windows-latest
20+
runs-on: windows-2022
2121
steps:
2222
- uses: actions/checkout@v6
2323

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
4040
build-desktop:
4141
needs: validate
42-
runs-on: windows-latest
42+
runs-on: windows-2022
4343
permissions:
4444
contents: read
4545

Directory.Build.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<PropertyGroup Condition="'$(GenerateDocumentationFile)'=='true'">
3+
<!-- XML docs are generated for release packages, but not every public API is documented yet. -->
4+
<NoWarn>$(NoWarn);CS1591</NoWarn>
5+
</PropertyGroup>
6+
</Project>

OpenSourceToolkit.Converters/ImageConverter.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
using System;
1+
using System;
22
using System.Drawing;
33
using System.Drawing.Imaging;
44
using System.IO;
55
using System.Runtime.Versioning;
66

77
namespace OpenSourceToolkit.Converters
88
{
9+
/// <summary>
10+
/// Provides basic image conversion helpers for file and byte-array inputs.
11+
/// </summary>
912
[SupportedOSPlatform("windows")]
1013
public static class ImageConverter
1114
{
15+
/// <summary>
16+
/// Converts an image file to the specified output format.
17+
/// </summary>
18+
/// <param name="inputPath">Path to the source image file.</param>
19+
/// <param name="outputPath">Path where the converted image should be saved.</param>
20+
/// <param name="format">Image format to use for the output file.</param>
1221
public static void Convert(string inputPath, string outputPath, ImageFormat format)
1322
{
1423
using (var image = Image.FromFile(inputPath))
@@ -17,6 +26,12 @@ public static void Convert(string inputPath, string outputPath, ImageFormat form
1726
}
1827
}
1928

29+
/// <summary>
30+
/// Converts image bytes to the specified output format.
31+
/// </summary>
32+
/// <param name="inputBytes">Source image bytes.</param>
33+
/// <param name="format">Image format to use for the converted bytes.</param>
34+
/// <returns>The converted image bytes.</returns>
2035
public static byte[] Convert(byte[] inputBytes, ImageFormat format)
2136
{
2237
using (var inputStream = new MemoryStream(inputBytes))

0 commit comments

Comments
 (0)