-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack Buffer Overrun Exception when a worksheet contains a picture #812
Comments
Are you using the latest version of EPPlus? |
Yes, version 6.1.3 |
Looks like a missing GDI issue. Are you using the free tier in Azure? |
No - Standard S3 Plan ( 4 vCPU and 7 GB Memory) |
Does the workbooks open correctly if you run EPPlus locally? |
Yes - everything works perfect locally and on-premise servers. But crashes direct in Azure App Service (Windows Plan - .Net Framework). |
If we remove the picture from the worksheet it works as well. |
Yes that is the correct setting. This is the file with the image causing the error. I have tried with some other images and this is the only one that fails. |
This is an EMF image. I wonder if Azure's GDI implementation does not support EMF's. I will try to see if I can replicate this issue. We have a build in handler for all image types, but it seems that it does not fallback on it when an exception is thrown in this case. |
Obviously the quick fix for you is to change the image to a png or jpg and see if it works. |
Yes other image types seem to work. |
I will remove the usage of System.Drawing.Common in for .NET framework in the GenericImageHandler , so it will use the build-in instead (Note that .NET core, .NET 6 & 7 already uses it). This should solve this issue. |
….Drawing.Common for .NET framework and #813-Deleting rows deleted cf and dv for full rows/columns
I use EPPlus in a web application running in Azure.
Version of .NET Framework is 4.8.4526.0.
Accessing worksheets containing drawings of type picture makes the application to chrash.
Crashdump from Azure:
InlinedCallFrame
InlinedCallFrame
DomainNeutralILStubClass.IL_STUB_PInvoke
System.Drawing.Image.FromStream
OfficeOpenXml.Drawing.GenericImageHandler.GetImageBounds
OfficeOpenXml.ExcelImageSettings.GetImageBounds
OfficeOpenXml.Drawing.PictureStore.GetImageBounds
OfficeOpenXml.Drawing.PictureStore.AddImage
OfficeOpenXml.Drawing.PictureStore.SavePicture
OfficeOpenXml.Drawing.ExcelImage.SetImageContainer
OfficeOpenXml.Drawing.ExcelPicture..ctor
OfficeOpenXml.Drawing.ExcelDrawing.GetDrawingFromNode
OfficeOpenXml.Drawing.ExcelDrawings.AddDrawings
OfficeOpenXml.Drawing.ExcelDrawings..ctor
OfficeOpenXml.ExcelWorksheets.Delete
The text was updated successfully, but these errors were encountered: