File formats are detected incorrectly

Hi all,

During testing I faced with some issues on the latest (downloaded 10 of September) Aspose.Total components. The goal of using Aspose components is to determine file type/format at runtime and get the reason why file cannot be opened if so: unknown file format, invalid password or other. So I found inconsistency in exceptions raised by Aspose components.

Please review my findings and give me an answer whether it possible to get the situation changed, because (I believe you agree with following) determining the reason of failure by exception’s message is NOT good practice.

I also attached “Aspose file format detector.xlsx” which illustrates the point in the list below.

1. Aspose.Slides.Pptx.PptxException (Message: Unknown file format.) is raised in following situations:

1.1. While opening DOC/DOT/XLS/XLT file via Aspose.Slides.Pptx.PresentationEx (string path) constructor. It would be better to raise Aspose.Slides.Pptx.PptxUnsupportedFormatException.

1.2. While opening password protected DOC/DOT/XLS/XLT (without specifying password at all) files via Aspose.Slides.Pptx.PresentationEx (string path) constructor. It would be better to raise something like InvalidPasswordOrMalformedException.

2. POT/PPT (regular and password protected) files are successfully opened by Aspose.Cells. Workbook() and FileFormat is Excel97To2003 . Believe it would be better to raise exception with code = ExceptionType.FileFormat.

3. System.NullReferenceException is raised instead of Aspose.Slides.Pptx.PptxUnsupportedFormatException when I try to open following files:

3.1. DOCM/DOCX/DOTM/DOTX/XLSM/XLSX/XLTM/XLTX via Aspose.Slides.Pptx.PresentationEx.

3.2. password protected (with correct password being specified) DOCM/DOCX/DOTM/DOTX/XLSM/XLSX/XLTM/XLTX via Aspose.Slides.Pptx.PresentationEx.

4. Aspose.Slides.PptReadException (Message: Couldn't read "PowerPoint Document" record.) is raised when I try to open password protected (without specifying any password at all) POT/PPT via Aspose.Slides.Presentation constructor. It would be better to raise something like InvalidPasswordOrMalformedException.

5. Aspose.Slides.Pptx.PptxReadException. (Message: This file is not correctly encrypted or malformed) is raised instead of Aspose.Slides.UnsupportedFormatException when I try to open password protected (with correct password being specified) POT/PPT/XLS/XLT/DOC/DOT via Aspose.Slides.Pptx.PptxPresentation constructor. It would be better to raise Aspose.Slides.Pptx.PptxUnsupportedFormatException.

6. Aspose.Slides.Pptx.PptxReadException (Message: Can't read MSCDFileSystem.) is raised instead of Aspose.Slides.Pptx.PptxUnsupportedFormatException when I try to open password protected (with correct password being specified) RTF via Aspose.Slides.Pptx.PptxPresentation constructor. It would be better to raise Aspose.Slides.Pptx.PptxUnsupportedFormatException.

<span style=“font-size:9.0pt;mso-bidi-font-size:11.0pt;line-height:115%;
font-family:“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
color:#548DD4;mso-themecolor:text2;mso-themetint:153;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>System.Exception <span style=“font-size:9.0pt;mso-bidi-font-size:11.0pt;line-height:115%;font-family:
“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>(Message:
Presentation is encrypted but LoadOptions.Password is null. Set right password
or set LoadOptions.OnlyLoadDocumentProperties to true.) when I try to open
password protected (without specifying password at all) DOCM/DOCX/DOTM/DOTX/XLSB/XLSM/XLSX/XLTM/XLTX/PPTM/PPTX/POTM/POTX.
It would be better to raise something like InvalidPasswordException.

<span style=“font-size:9.0pt;mso-bidi-font-size:11.0pt;line-height:115%;font-family:
“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>
<span style=“font-size:9.0pt;mso-bidi-font-size:11.0pt;line-height:115%;font-family:
“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Best regards,
<span style=“font-size:9.0pt;mso-bidi-font-size:11.0pt;line-height:115%;font-family:
“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Alex Shloma

Hi Alex Sholma,

I have observed the requirements shared by you and like to share that an issue with ID SLIDESNET-34649 has been created as enhancement in our issue tracking system to further investigate the possibility of implementing the requested exception messages support in Aspose.Slides. This thread has been linked with the issues so that you may be automatically notified once the support will be available.

Many Thanks,

Hi,

LiteraCorp:


2. POT/PPT (regular and password protected) files are successfully opened by Aspose.Cells. Workbook() and FileFormat is Excel97To2003 . Believe it would be better to raise exception with code = ExceptionType.FileFormat.


I would like to address your issue regarding Aspose.Cells component. Could you attach your template POT/PPT files and paste your sample code (using Aspose.Cells APIs) here that you are using to evaluate your issue on our end, we will check your issue soon.


Thank you.

Hi


Please see attached archive (sample project with documents).

Many thanks,
Alex Shloma

Hi,


Thanks for the sample project and sharing template Powerpoint files.

After an initial test, I observed the issue as you have mentioned. I have tested your project with v7.5.3 and all the PowerPoint files are detected as Excel2003 file format, see the screen shot attached here. I have logged a ticket with an id “CELLSNET-41995” for your issue. We will look into your issue soon.

Once we have any update on it, we will let you know here.

Thank you.

Thank you for quick response!

Best regards,

Alex Shloma

Hi,


Please try the latest version/fix: Aspose.Cells for .NET v7.5.3.2

An exception will be thrown when opening a PPT file with
Aspose.Cells now.<o:p></o:p>


Thank you.

The issues you have found earlier (filed as SLIDESNET-34649) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as CELLSNET-41995) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thank you,


Please do not close ticket because not all issues mentioned there are fixed.

Best regards,
Alex Shloma

Hi Alex Shloma,


Can you please share that which of the issues are not fixed are pending related to Aspose.Slides so that we may peruse them.

Many Thanks,

Hi Alex Shloma,

Thanks for using Aspose.Total.

We have fixed your Aspose.Cells related issue. If you are still facing any issue relating to Aspose.Cells, please let us know. We will look into them and fix them asap.

Hi Shakeel,


In a few days I will check Aspose.Cells and let you know.

Many thanks,
Alex Shloma
Hi,

I tried to replicate the issue #2 on Aspose.Cells 7.6.0.0 – failed. The issue was fixed.

So I ask not to close this tickeе in order to keep tracking of the progress on other issues I described in the very first post. All connected with the way Aspose.Slides process NOT PowerPoint files.

You mentioned that the issue with ID SLIDESNET-34649 has been marked as enhancement, so I will use this ticket to get updates on this. But if you can provide me with a RSS link for SLIDESNET-34649, I will use it

Thanks
Alex Shloma

Hi Alex,


Thanks for your feedback and good to know that your issue regarding Aspose.Cells is fixed by our new version/fix now.

Well, different tickets are logged for your mentioned different issues. When an issue is fixed, we close its respective ticket that was logged for it into our database. Also, closing a ticket (e.g “CELLSNET-41995”) does not mean that your thread is closed. The thread is always open until all of your issues are resolved.

Hopefully our Aspose.Slides team will figure out your unresolved issues soon.

Thank you.

Hi Alex,


As far as your comments regarding SLIDESNET-34649 are concerned, I like to share that we have introduced support for appropriate exception messages in our latest release Aspose.Slides for .NET 7.9.0. I suggest you to please verify the NOT PowerPoint presentation samples using Aspose.Slides for appropriate exception messages on your end and share your kind feedback with us.

Many Thanks,

Hi Mudassir,


We downloaded the latest version of Aspose.Slides and tested it in our environment against the set of files. And we are pappy to confirm that special exceptions are now thrown when we tried to open not PowerPoint files using Aspose.Slides. And that is great news=)


Here is the list of our findings. These things might make the Aspose.Slides even more tempting. I attached the workbook which contains the results of our testing (“Aspose file format detection.xlsx”). We highlighted with yellow/orange color things that might be changed from our point of view.


1. We highlighted cells with “P”. We consider that it is better to throw UnsupportedFormatException than InvalidPasswordException. (please see InvalidPasswordException_thrown.jpg)


InvalidPasswordException is thrown when we tried to open DOCM, DOCX, DOTM, DOTX files with Aspose.Cells 7.6.0.0. Believe the right way is to throw UnsupportedFormatException as it is with DOC and DOT files.


2. We highlighted 2 cells with “Opened” where we think it would be better to throw UnsupportedFormatException instead, as it is with password protected POT/PPT files (see the last column in the workbook). In this scenario we tried to open regular POT/PPT files with Aspose.Slides.Pptx.PresentationEx and they were opened. We did not checked whether the content was read correctly.


3. We highlighted 6 cells with orange color from the Aspose.Cells region where file format is not detected correctly. Templates were recognized as NOT templates. (please see Templates_are_not_recognized.jpg)


Please consider our ideas and let us know your thoughts.


Many Thanks,

Alex Shloma

Hi,

Thanks for providing us template file highlighting your issues and suggestions.


LiteraCorp:

InvalidPasswordException is thrown when we tried to open DOCM, DOCX, DOTM, DOTX files with Aspose.Cells 7.6.0.0. Believe the right way is to throw UnsupportedFormatException as it is with DOC and DOT files.








Could you share some sample DOCM, DOCX, DOTM and DOTX file formats, we will evaluate your issue and log a separate ticket for it into our database (if possible).


Thank you.

Hi,

Here is the solution and our password protected Open XML DOCX/DOCM/DOTM/DOTX files you asked for.

I should note that the same situation (described in the item #1 of my previous post) is also observed with:

· DOCM/DOCX/DOTM/DOTX when they are opened by Aspose.Slides.Pptx.Aspose.Slides.Pptx.

· POTM/POTX/PPTM/PPTX when they are opened by Aspose.Words or Aspose.Cells.

· XLSB/XLSM/XLSX/XLTM/XLTX when they are opened by Aspose.Slides.Pptx.Aspose.Slides.Pptx or Aspose.Words

Do you have any update about other points (#2 and #3)?

Thank you,

Alex Shloma

Hi Alex Shloma,

I have verified the password product MS Word files shared in your last post and have tested with Aspose.Slides on my end. I have been able to observed the requirement and agree with the fact that UnSupportedFormat exception should be thrown for MS Word files when using Aspose.Slides whether they are plain or password protected. An issue with ID SLIDESNET-34759 has been added as enhancement in our issue tracking system to provide the requested support. This thread been linked with the issue so that you may be automatically notified once the issue will be resolved.

For your following point,

2. We highlighted 2 cells with “Opened” where we
think it would be better to throw UnsupportedFormatException instead, as it is
with password protected POT/PPT files (see the last column in the workbook). In
this scenario we tried to open regular POT/PPT files with Aspose.Slides.Pptx.PresentationEx and they were opened. We did not
checked whether the content was read correctly.

in this post , can you please explain is it concerning to Aspose.Slides or not. Please share further elaboration in this regard if it is related to Aspose.Slides so that I may help you better.

Many Thanks,