Fix Linux social card rendering#335
Conversation
Code Review: Fix Linux social card renderingOverviewThis PR solves a real problem — in-process Magick.NET SVG rendering causes native fontconfig crashes on Linux. The approach (shell out to the system Issues1. Unobserved task exception / stream disposed before read completes (bug)In var errorTask = process.StandardError.ReadToEndAsync();
var exited = process.WaitForExit(30_000);On the success path, the method returns The fix is to consume or synchronously complete // After WaitForExit returns true and ExitCode == 0:
errorTask.GetAwaiter().GetResult(); // drain stderr; process has already exited so this is instantaneous
return File.ReadAllBytes(pngPath);Alternatively, call the parameterless 2. PATH scanning on every render — cache the resolved command
private static readonly Lazy<ExternalImageMagickCommand?> CachedExternalImageMagickCommand =
new(ResolveExternalImageMagickCommand);3.
|
Summary
Verification