mono / SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.4k stars 535 forks source link

Compatible version of libSkiaSharp.SO with aws lambda #833

Closed saumyaverma1002 closed 4 years ago

saumyaverma1002 commented 5 years ago

We are using Neodynamic TheramlLabel SDK(8.0.19.401) from Nuget package in AWS Lambda application which uses SkiaSharp(1.60.0) library. Now, When we are using inbuilt function of Neodynamic SDK called "ExportToPDF" that uses "libSkiaSharp.dll" to run, but it is failing at "ExportToPDF" method as it is not getting libSkiaSharp.dll.(Dll not Found Exception). So then we added "libSkiaSharp.SO" file(Downloaded from GitHub) to the solution externally.

Now after adding thsi SO file "ExportToPDf" function works but fails in some cases where font property is Bold, Italic of Font family Arial Unicode MS.

(Using SO file because our application runs on below AWS lambda which is using only linux operating system) Our AWS lambda is using Amazon linux instance of below OS details: NAME="Amazon Linux AMI" VERSION="2017.03" ID="amzn" ID_LIKE="rhel fedora" VERSION_ID="2017.03" PRETTY_NAME="Amazon Linux AMI 2017.03" ANSI_COLOR="0;33" CPE_NAME="cpe:/o:amazon:linux:2017.03:ga" HOME_URL="http://aws.amazon.com/amazon-linux-ami/ "

Could you please let us know "libSkiaSharp.SO" is compatible with above aws lambda linux OS ? If not, please let us know the workaround if any.

rkstar007 commented 5 years ago

@saumyaverma1002 : did you check libSkiaSharp.SO on Ubuntu machine ? As per @mattleibow the pre-built native library works (it was built on Ubuntu 14.04). Custom Linux distros might need to rebuild.

Also, Run below command to find the missing libraries if any.

# ldd libSkiaSharp.so

Checkout this issue: https://github.com/mono/SkiaSharp/issues/288

saumyaverma1002 commented 5 years ago

Hi,

We are using below OS in our AWS lambda not ubuntu NAME="Amazon Linux AMI" VERSION="2017.03" ID="amzn" ID_LIKE="rhel fedora"

Kindly guide to resolve the issue

mattleibow commented 5 years ago

The issue might be missing dependencies - most commonly the fontconfig library. Typically, you need to sudo install that first. (thanks @kstar007 for getting in on that)

If you cannot install if for some reason, we are working on a new package that does not have any dependencies which should work. This was just merged in with #821.

mattleibow commented 5 years ago

@saumyaverma1002 are you able to install packages on the labmda instance? Typically you will need fontconfig.

vijayasurya20 commented 4 years ago

Hi, I am also facing the similar "Unable to load DLL libSkiaSharp or one of its dependent assemblies" issue even after replace the libskiaSharp.SO file manually. As you mentioned, I suppose to think missing of "fontconfig" library is the reason behind this issue. We have been facing difficulties to install the fontconfig library manually into AWS lambda due to its restriction.

Can you please let me know in which release this below fix will get included? https://github.com/mono/SkiaSharp/pull/821

This details will be helpful for us to upgrade to the specific version to overcome from this issue.

Gillibald commented 4 years ago

This "fix" should be available threw the nightly feed here: https://nugetized.blob.core.windows.net/skiasharp-eap/index.json

Just use the NoDependencies package