Free Support Forum - aspose.com

Wrong load format detection

Hi,

I’ve faced uncertainties in your API (Slides.NET version 21.4). I am trying to detect load format for my *.pps file using this code:

string input = @"C:\input.pps";

using (FileStream fs = new FileStream(input, FileMode.Open, FileAccess.Read))
{
    using (MyStream ms = new MyStream(fs))
    {
        PresentationFactory presentationFactory = new PresentationFactory();
        IPresentationInfo presentationInfo = presentationFactory.GetPresentationInfo(ms);
        Console.WriteLine(presentationInfo.LoadFormat);
    }
}

The problem is that I am using object “MyStream” which is my class inherited from System.IO.Stream. It seems like your PresentationInfo class detect LoadFormat wrong with my inherited stream, but works fine with standart Stream. When I pass MyStream to PresentationInfo - I receive wrong LoadFormat (ppt). When I pass standart System.IO.Stream - I receive correct LoadFormat (pps) (screenshoot, full code in Program.cs file and my *.pps file are attached).

CodeAndPpsFile.zip (124.8 KB)
image.png (848 Bytes)

@AlexBilakovskyi,
Thank you for the issue description. I reproduced the error and received the same result. I’ve logged the issue in our tracking system with ID SLIDESNET-42555. Our development team will investigate this case. You will be notified when it is fixed.