Converting emails to PNG for thumbnail creation results in a “File type not supported” exception.
I analyzed the problem and found out, that GroupDocs.Conversion 22.1 attempts to convert the ZIP attachment of the email.
Attachment test 6 ZIP.zip (49.2 KB)
This problem seems to be new with version 22.1.
var emailLoadOptions = new EmailLoadOptions();
emailLoadOptions.ResourceLoadingTimeout = TimeSpan.FromSeconds(10);
//emailLoadOptions.ConvertOwned = false;
var imgOptions = new ImageConvertOptions()
{
Format = FileTypes.ImageFileType.Png,
//convert only the first page for thumbnail
PageNumber = 1,
PagesCount = 1,
Width = 256,
};
using (var conv = new Converter(documentPath, () => emailLoadOptions))
{
string filePath = @"outputConversion{0}.png";
Contracts.SavePageStream getPageStream = page => new FileStream(string.Format(filePath, page), FileMode.Create);
conv.Convert(getPageStream, imgOptions);
}
As a workaround, I set ConvertOwned to false.
This should not be needed though, as I only want to convert the first page anyway.