Open Algorithman opened 1 year ago
Bit background: I added my logo and favicon via SampleMediaUtility.CreateMediaFileAsync which does not set the pixel width/height in ApplyToStorage since it throws in GetPixelSizeFromSvg so it remains NULL. This in turn leads to this error since the exception is not handled.
This also applies to ico files which are added in the same way.
Since width/height 0/0 seems to be enough there maybe a change in public static (Size Size, IImageFormat Format) GetPixelSizeWithFormat(Stream input, string mime, bool leaveOpen = true)
with a check for image/x-icon would suffice like this:
if (mime == "image/x-icon")
{
return (new Size(0,0), null); // No format for ICO
}
Describe the bug In ImageHeader.cs method GetPixelSizeFromSvg you need to add the DtdProcessing = DtdProcessing.Parse like this:
line 251:
using (var reader = XmlReader.Create(input, new XmlReaderSettings() { DtdProcessing = DtdProcessing.Parse }))
To Reproduce Steps to reproduce the behavior:
Desktop (please complete the following information):
Additional context Stacktrace: