Extracting Images from Presentation in C# Throws ArgumentException

I have a demo1.pptx file, and when I extracted the image on the 12th slide, an ArgumentException was thrown.
I copied this file as demo2.pptx, then deleted all the slides after the 12th slide, and then extracted
the same image, and it worked normally.

The Demo File

ExtraImageError.zip (700.1 KB)

The Screenshot

20240302121534.jpg (180.1 KB)

Sample Code

void Main()
{
	var file1 = @"C:\Users\54390\Downloads\demo1.pptx";
	var file2 = @"C:\Users\54390\Downloads\demo2.pptx";
	
	//demo1.pptx
	var ppt = new Aspose.Slides.Presentation(file1);
	var slide = ppt.Slides[11];
	ExtraImage(slide);

	//demo2.pptx
	ppt = new Aspose.Slides.Presentation(file2);
    slide = ppt.Slides[11];
	ExtraImage(slide);
}

private void ExtraImage(ISlide slide)
{
	for (int i = slide.Shapes.Count - 1; i >= 0; i--)
	{
		var shape = slide.Shapes[i];

		if (shape is Aspose.Slides.PictureFrame)
		{
			var pf = shape as IPictureFrame;
			pf.PictureFormat.Picture.Image.Dump();
		}
	}
}

Version Info

Aspose.Slides for Net 24.2.0

@sullivan,
Thank you for contacting support. I am working on the issue and will get back to you soon.

@sullivan,

In Aspose.Slides for .NET, the IPPImage interface does not contain the Dump method. It looks like the issue is not related to Aspose.Slides. Please check your code carefully.

@andrey.potapov

Sorry, dump is only supported in LINQPad, You can use Console.WriteLine() instead.

Console.WriteLine(pf.PictureFormat.Picture.Image);

@sullivan,
Thank you for the details. I am working on the issue and will get back to you soon.

@sullivan,
Unfortunately, I was unable to reproduce the exception you described. Please share the following additional information:

  • OS version on which the error appears
  • .NET target platform in your app
  • stack trace of the error

@andrey.potapov
OS Version : Windows 11 家庭中文版
.NET Version : .NET Framework 4.7
stack trace of the error:
20240305210828.jpg (169.7 KB)

@sullivan,
Thank you for the additional information.

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): SLIDESNET-44463

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.

@andrey.potapov
Have you reproduced this issue?

@sullivan,
No, but our developers will check the issue you encountered. Thank you for your patience.