Files
2022-05-27 00:01:54 +08:00

41 lines
1.4 KiB
C#
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using NUnit.Framework;
using SkiaSharp;
using R = System.Application.Properties.Resources;
namespace System.Application;
[TestFixture]
public class SkiaTest
{
//[Test]
//public void CreateImage_Jacky_Fideles6() => LoadImage(R.Jacky_Fideles6);
[Test]
public void CreateImage_Jacky_1245620_hero() => LoadImage(R._1245620_hero);
//[Test]
//public void CreateImage_Jacky_490390_header() => LoadImage(R._490390_header);
static void LoadImage(byte[] bytes) => LoadImage(new MemoryStream(bytes));
static void LoadImage(Stream stream)
{
using var imgStream = new SKManagedStream(stream);
using var codec = SKCodec.Create(imgStream, out SKCodecResult result);
TestContext.WriteLine(result);
/*
* System.ArgumentNullException : Value cannot be null. (Parameter 'buffer')
* 堆栈跟踪: 
* SKManagedStream.OnReadManagedStream(IntPtr buffer, IntPtr size)
* SKManagedStream.OnRead(IntPtr buffer, IntPtr size)
* SKAbstractManagedStream.ReadInternal(IntPtr s, Void* context, Void* buffer, IntPtr size)
* SkiaApi.sk_codec_new_from_stream(IntPtr stream, SKCodecResult* result)
* SKCodec.Create(SKStream stream, SKCodecResult& result)
* https://github.com/mono/SkiaSharp/issues/1551
* https://github.com/mono/SkiaSharp/issues/2076
* https://github.com/mono/SkiaSharp/issues/1621
*/
}
}