ToData now supports multiple formats.

Introduce `ProgrartC` to build a single image to work with other build tools.
Added a `CombinedStorageProvider` to allow aggregate storage providers.
This commit is contained in:
Creeper Lv
2026-01-16 00:36:38 +11:00
parent e4e868a393
commit dce1ff2518
9 changed files with 261 additions and 17 deletions

View File

@@ -34,10 +34,11 @@ namespace Progrart.Core.ProjectSystem
return;
using var reader = new StreamReader(stream);
var img = executor.RenderImage(item.Size, reader.ReadToEnd(), args);
using var img_stream = await provider.TryOpenWrite(Path.Combine(project.OutputDir, item.Target ?? item.Source + ".png"));
var outputFile= Path.Combine(project.OutputDir, item.Target ?? item.Source + ".png");
using var img_stream = await provider.TryOpenWrite(outputFile);
if (img_stream is null)
return;
img.DrawingCore.ToData().SaveTo(img_stream);
img.DrawingCore.ToData(Path.GetExtension(outputFile)).SaveTo(img_stream);
img_stream.Flush();
}
public async Task Build(string targetConfig, int maxJobCount = 1)