When processing this file test.docx (37.6 KB) on Linux, our service is killed with an unhandled exception from SkiaSharp. The stack trace does not contain any of our code, and can’t seem to be trapped (the triggering code is in a try-catch, and nothing is caught).
The service threw an unhandled exception, System.ArgumentNullException: Value cannot be null. (Parameter 'buffer')
at SkiaSharp.SKManagedStream.OnReadManagedStream(IntPtr buffer, IntPtr size)
at SkiaSharp.SKManagedStream.OnRead(IntPtr buffer, IntPtr size)
at SkiaSharp.SKAbstractManagedStream.ReadInternal(IntPtr s, Void* context, Void* buffer, IntPtr size)
Removing the form element (the checkbox in the grey area near the top) and the file processes successfully. Other documents process successfully on Linux. The same code on Windows can process the document successfully.
The relevant code snippet (try-catch removed):
var pages = new List<MemoryStream>();
var pageStreamFactory = new ContentPageStreamFactory(pages);
using (var viewer = new Viewer(stream))
{
var options = new JpgViewOptions(pageStreamFactory)
{
Quality = 50
};
viewer.View(options, 1);
}
var image = Image.FromStream(pages.FirstOrDefault());
Linux version is Red Hat Enterprise Linux release 8.4 (Ootpa) 4.18.0-305.19.1.el8_4.x86_64
.NET is version 5.0.11
GroupDocs.Viewer version is 21.10.0
SkiaSharp version is 2.80.3
SkiaSharp.NativeAssets.Linux version is 2.80.3