Aspose.Word can open jpg file without exception

Hi, Team.

We have migrated our project from Aspose.Words version 22.4 to 23.3 and I have noticed that some behaviers were changed. I am not sure that it is a bug but could you clarify it?

We have “image_as_doc.doc” image_as_doc.zip (7.0 KB)
document that actulally a jpg file. Word cannot open this file. On version 22.4 when we try to open this file, Aspose throws an error: “Unsupported file format: Unknown”. But when we try to open this file on version 23.3, Aspose opens it without error. But if file has “docx” extension, Aspose produces an error.
Is it an Aspose.Word bug or correct behavier?

Thank you in advince,
Svetlana

@skorpusova
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25321

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

As a temporary solution, you can use FileFormatUtil to detect file format before loading the file:

FileFormatInfo info = FileFormatUtil.DetectFileFormat(@"C:\Temp\in.jpg");
Console.WriteLine(info.LoadFormat); // Returns Unknown for simple JPG images

@skorpusova We’ve checked and Word opens the problematic JPG without any problems as TXT document. So the issue is considered as not a bug, as Aspose.Words mimic Word in this case.

The issues you have found earlier (filed as WORDSNET-25321) have been fixed in this Aspose.Words for .NET 24.2 update also available on NuGet.