You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have created the SKBitmap and drawn a rectangle, circle, and line in .NET using AWS Lambda. We encountered an issue while using SkiaSharp.NativeAssets.Linux NuGet in an AWS Lambda - we faced the 'Unable to load shared library 'libSkiaSharp' exception. However, this issue does not occur when using .NET6 AWS Lambda.
Platform: AWS Lambda
Visual Studio version: 2022
.NET version : .NET8
SkiaSharp version : 2.88.6
But, you can also share a short block of code here:
publicstringFunctionHandler(ILambdaContextcontext){//Define the image dimensionsintwidth=800;intheight=600;stringbase64String;//Create a new bitmapusing(varbitmap=new SKBitmap(width, height)){// Create a canvas to draw on the bitmapusing(varcanvas=new SKCanvas(bitmap)){// Clear the canvas with a white color
canvas.Clear(SKColors.White);// Define the paint for drawing shapesvarpaint=new SKPaint
{Color= SKColors.Blue,IsAntialias=true,Style= SKPaintStyle.Stroke,StrokeWidth=5};// Draw a rectanglevarrect=new SKRect(100,100,300,300);
canvas.DrawRect(rect, paint);// Draw a circle
paint.Color = SKColors.Red;
canvas.DrawCircle(400,400,100, paint);// Draw a line
paint.Color = SKColors.Green;
canvas.DrawLine(500,100,700,300, paint);// Save the bitmap to a fileusing(varimage= SKImage.FromBitmap(bitmap))using(vardata= image.Encode(SKEncodedImageFormat.Png,100))using(varmemoryStream=new MemoryStream()){
data.SaveTo(memoryStream);byte[]imageBytes= memoryStream.ToArray();base64String= Convert.ToBase64String(imageBytes);
Console.WriteLine(base64String);// Print or return the base64 string}}}returnbase64String;}// some C# code here
You can also share some XAML:
<!-- xaml code here -->
Expected Behavior
The program should run without any exceptions in AWS Lambda .NET8
Actual Behavior
Get an exception is .NET version 8
Working fine in .NET version 6
System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like Strace. If you're using glibc, consider setting the LD_DEBUG environment variable.
Version of SkiaSharp
Other (Please indicate in the description)
Last Known Good Version of SkiaSharp
2.88.2 (Previous)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Windows 11
Devices
Asus 12th Gen Intel(R) Core(TM) i5-1235U 1.30 GHz
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Description
We have created the SKBitmap and drawn a rectangle, circle, and line in .NET using AWS Lambda. We encountered an issue while using SkiaSharp.NativeAssets.Linux NuGet in an AWS Lambda - we faced the 'Unable to load shared library 'libSkiaSharp' exception. However, this issue does not occur when using .NET6 AWS Lambda.
Platform: AWS Lambda
Visual Studio version: 2022
.NET version : .NET8
SkiaSharp version : 2.88.6
Code
The best way to share code for larger projects is a link to a GitHub repository: https://github.com/user/repo/tree/bug-123
But, you can also share a short block of code here:
You can also share some XAML:
<!-- xaml code here -->
Expected Behavior
The program should run without any exceptions in AWS Lambda .NET8
Actual Behavior
Get an exception is .NET version 8
Working fine in .NET version 6
System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like Strace. If you're using glibc, consider setting the LD_DEBUG environment variable.
Version of SkiaSharp
Other (Please indicate in the description)
Last Known Good Version of SkiaSharp
2.88.2 (Previous)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Windows 11
Devices
Asus 12th Gen Intel(R) Core(TM) i5-1235U 1.30 GHz
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: