I’m updating Aspose Cells from version 18.4 to version 18.12, but I have met an issue with some specific XLS that I need your help.
With version 18.4, I can load the files and image correctly without exception, but in new version 18.12, when I load a image inside the file, exception “Unexpected image type” will be thrown.
string inputFile = @“sample.xls”;
Aspose.Cells.LoadOptions option = new Aspose.Cells.LoadOptions();
option.MemorySetting = MemorySetting.MemoryPreference;
FileStream inStream = new FileStream(inputFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Workbook workbook = new Workbook(inStream, opt);
foreach(Worksheet worksheet in workbook.Worksheets)
Aspose.Cells.Drawing.PictureCollection pc = worksheet.Pictures;
foreach(Picture pic in pc)
String fileExtension = pic.ImageFormat.ToString();
Here is my sample file:
sample.zip (3.0 MB)
If you want to know another information, please reply here.
Dung. H Nguyen