We tested this issue with the following sample code using the sample Excel file and it generated the 300+ MB tiff image successfully. We used the most recent version and did not find any error.
var workbook = new Workbook("Tour.xlsx");
var imageSaveOptions = new ImageSaveOptions(SaveFormat.TIFF);
imageSaveOptions.ImageOrPrintOptions.TiffCompression = Aspose.Cells.Rendering.TiffCompression.CompressionNone;
imageSaveOptions.ImageOrPrintOptions.HorizontalResolution = 96;
imageSaveOptions.ImageOrPrintOptions.VerticalResolution = 96;
var tiffStream = new MemoryStream();
workbook.Save("out.tiff", imageSaveOptions);
At the moment, I am unable to replicate this issue but since the output Tiff is more than 300 MB, so this error could occur, we will look into this issue further and update you asap.
We are afraid, we are unable to replicate your issue. Please download and try the following sample test project and execute it at your end and see if you could replicate the issue with this project.
If you are unable to replicate it, then modify the project in such a way that it replicates the exception and then submit it to us. We need your sample project and sample Excel file(s) that replicate the exception to look into this issue further.
Here’s more information on what’s happening. I disabled “Just My Code” in Visual Studio and finally saw that the actual error behind the “generic error” is a “System.OutOfMemoryException”. I was able to workaround this issue by changing the TiffCompression setting.
Is it possible to return this information in the error handler when an out of memory error occurs?
Yes, that’s possible. Before that, please provide us your sample project and sample Excel file that replicates the error. Once, we replicate it at our end, we will log it in our database with your comments for product team consideration and investigation. Thanks for your help in this regard and have a good day.
We have looked into this issue and found that when the exception: “A generic error occurred in GDI+.” is thrown by C# GDI API, we may not able to return actual error behind it.