Browse Source

Add Stream overload for Png AddMetadata

pull/240/head
Ionite 1 year ago
parent
commit
9cacf9283b
No known key found for this signature in database
  1. 11
      StabilityMatrix.Avalonia/Helpers/PngDataHelper.cs

11
StabilityMatrix.Avalonia/Helpers/PngDataHelper.cs

@ -16,6 +16,17 @@ public static class PngDataHelper
private static readonly byte[] Text = { 0x74, 0x45, 0x58, 0x74 };
private static readonly byte[] Iend = { 0x49, 0x45, 0x4E, 0x44 };
public static byte[] AddMetadata(
Stream inputStream,
GenerationParameters generationParameters,
InferenceProjectDocument projectDocument
)
{
using var ms = new MemoryStream();
inputStream.CopyTo(ms);
return AddMetadata(ms.ToArray(), generationParameters, projectDocument);
}
public static byte[] AddMetadata(
byte[] inputImage,
GenerationParameters generationParameters,

Loading…
Cancel
Save