Sicos1977 / MSGReader

C# Outlook MSG file reader without the need for Outlook
http://sicos1977.github.io/MSGReader
MIT License
478 stars 168 forks source link

New Version 4.4.3 ImageSharp.UnknownImageFormatException #298

Closed LucaBastelt closed 2 years ago

LucaBastelt commented 2 years ago

Describe the bug In one of our UnitTests we now get a SixLabors.ImageSharp.UnknownImageFormatException on parsing an msg file with a rtf formatted body. With version 4.3.2 this was not an issue.

To Reproduce Using the test msg file in 20 Testdokument Zeile 20.zip we use a simple new Storage.Message(MsgWithRtfBody);

Expected behavior The expected behavior is that the created message object has a filled BodyRtf property

Stacktrace

SixLabors.ImageSharp.UnknownImageFormatException
Image cannot be loaded. Available decoders:
 - BMP : BmpDecoder
 - TGA : TgaDecoder
 - JPEG : JpegDecoder
 - GIF : GifDecoder
 - PNG : PngDecoder
 - Webp : WebpDecoder
 - TIFF : TiffDecoder
 - PBM : PbmDecoder

   at SixLabors.ImageSharp.Image.Load(Configuration configuration, Stream stream, IImageFormat& format)
   at SixLabors.ImageSharp.Image.Load(Configuration configuration, Stream stream)
   at SixLabors.ImageSharp.Image.Load(Stream stream)
   at MsgReader.Outlook.Storage.Attachment.SaveImageAsPng(Int32 bufferOffset)
   at MsgReader.Outlook.Storage.Attachment..ctor(Storage message, String storageName)
   at MsgReader.Outlook.Storage.Message.LoadAttachmentStorage(CFStorage storage, String storageName)
   at MsgReader.Outlook.Storage.Message.LoadStorage(CFStorage storage)
   at MsgReader.Outlook.Storage..ctor(String storageFilePath, FileAccess fileAccess)
   at MsgReader.Outlook.Storage.Message..ctor(String msgfile, FileAccess fileAccess)

Used Target Framework net6.0

Sicos1977 commented 2 years ago

I'll try to look into it tomorrow. I had to replace Microsoft MUAI with ImageSharp to fix another problem. I did not have any issues with my testcases so I have to figure out where this is comming from.

LucaBastelt commented 2 years ago

Thanks!

Sicos1977 commented 2 years ago

I would suggest to revert back to previous version as a temporary solution, it should work fine with .net 6.0 but gives reference errors with lower .NET versions because of a bug in MUAI

Sicos1977 commented 2 years ago

Fixed in the latest nuget package