When calling GetThumbnail() in an AWS Lambda the code fails with the below exception
{
"errorType": "AggregateException",
"errorMessage": "One or more errors occurred. (The type initializer for 'Gdip' threw an exception.)",
"stackTrace": [
"at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)",
"at lambda_method(Closure , Stream , Stream , LambdaContextInternal )"
],
"cause": {
"errorType": "TypeInitializationException",
"errorMessage": "The type initializer for 'Gdip' threw an exception.",
"stackTrace": [
"at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)",
"at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)",
"at Aspose.Slides.Slide.GetThumbnail(Size imageSize)",
"at \u0005 .\u0002(Size \u0002)",
"at \u0005 .\u0002(Single \u0002, Single \u0003)",
"at OfficeDocToImage.Function.ConvertPowerpointToImages(AmazonS3Client client, GetObjectResponse response, String s3Folder, String s3Bucket, OfficeDocToImageRequest request) in /.../udmOfficeDocToImage/src/OfficeDocToImage/Function.cs:line 93",
"at OfficeDocToImage.Function.FunctionHandler(APIGatewayProxyRequest apiRequest, ILambdaContext context) in /.../udmOfficeDocToImage/src/OfficeDocToImage/Function.cs:line 69"
],
"cause": {
"errorType": "DllNotFoundException",
"errorMessage": "Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory",
"stackTrace": [
"at Interop.Libdl.dlopen(String fileName, Int32 flag)",
"at System.Drawing.SafeNativeMethods.Gdip.LoadNativeLibrary()",
"at System.Drawing.SafeNativeMethods.Gdip..cctor()"
]
}
},
"causes": [
{
"errorType": "TypeInitializationException",
"errorMessage": "The type initializer for 'Gdip' threw an exception.",
"stackTrace": [
"at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)",
"at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)",
"at Aspose.Slides.Slide.GetThumbnail(Size imageSize)",
"at \u0005 .\u0002(Size \u0002)",
"at \u0005 .\u0002(Single \u0002, Single \u0003)",
"at OfficeDocToImage.Function.ConvertPowerpointToImages(AmazonS3Client client, GetObjectResponse response, String s3Folder, String s3Bucket, OfficeDocToImageRequest request) in /.../udmOfficeDocToImage/src/OfficeDocToImage/Function.cs:line 93",
"at OfficeDocToImage.Function.FunctionHandler(APIGatewayProxyRequest apiRequest, ILambdaContext context) in /.../udmOfficeDocToImage/src/OfficeDocToImage/Function.cs:line 69"
],
"cause": {
"errorType": "DllNotFoundException",
"errorMessage": "Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory",
"stackTrace": [
"at Interop.Libdl.dlopen(String fileName, Int32 flag)",
"at System.Drawing.SafeNativeMethods.Gdip.LoadNativeLibrary()",
"at System.Drawing.SafeNativeMethods.Gdip..cctor()"
]
}
}
]
}