We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Slides is throwing error Cannot allocate image in memory. Image size exceeds memory size

Hello,

We are receiving following error while extracting images from ppt slides (Attached the ppt):

Exception in thread “main” com.aspose.slides.ms.pbdb106a0.di: FrameworkException: Cannot allocate image in memory. Image size exceeds memory size
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.p2cbca448.pf4dd765c.af.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.p2cbca448.pf4dd765c.s.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.p2cbca448.pf4dd765c.s.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.bl$b.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.bc.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.bc.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.bl.for(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.bl.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.bl.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.bl.int(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.b.read(Unknown Source)
at javax.imageio.ImageReader.read(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.pf4dd765c.a.do(Unknown Source)
at com.aspose.slides.ms.core.System.Drawing.pf4dd765c.a.try(Unknown Source)
at com.aspose.slides.ms.pbdb106a0.p6a2feef8.b.do(Unknown Source)
at com.aspose.slides.ms.pbdb106a0.p6a2feef8.b.(Unknown Source)
at com.aspose.slides.ms.pbdb106a0.p6a2feef8.b.(Unknown Source)
at com.aspose.slides.p883e881b.ak.do(Unknown Source)
at com.aspose.slides.acg.new(Unknown Source)
at com.aspose.slides.acg.byte(Unknown Source)
at com.aspose.slides.Picture.do(Unknown Source)
at com.aspose.slides.sv.do(Unknown Source)
at com.aspose.slides.sv.do(Unknown Source)
at com.aspose.slides.sv.if(Unknown Source)
at com.aspose.slides.sv.(Unknown Source)
at com.aspose.slides.Slide.do(Unknown Source)
at com.aspose.slides.Slide.do(Unknown Source)
at com.aspose.slides.Slide.do(Unknown Source)
at com.aspose.slides.Slide.getThumbnail(Unknown Source)
at powerPointSlide.ImageExtractor.main(ImageExtractor.java:79)

Hi Fahad,


Thank you for posting.

I have observed your comments and like to request you to please share with us the code sample which you are using on your end so that we may investigate it further to help you out.

Best Regards,

Here is the code:
Aspose Slides - JAVA - Bullets are appearing differntly in Linux environment

Hi Fahad,


I have observed your comments and have worked with the data shared by you but I am unable to reproduce the specified issue. The code, shared by you, executes for about 4 minutes and then finishes without any output. Possibly the issue could be appearing because of the List because I have been able to create thumbnails of slides using Aspose.Slides for Java 15.9.0. I request you to please try using following sample code on your end to serve the purpose and then share your kind feedback with us.

//Instantiate a Presentation class that represents the presentation file
Presentation pres = new Presentation(“D:\1.6.ppt”);


for(int i=0 ; i<pres.getSlides().size(); i++)
{
//Access the first slide
ISlide sld = pres.getSlides().get_Item(i);

//Create a full scale image
BufferedImage image = sld.getThumbnail(1f, 1f);

//Save the image to disk in JPEG format
try
{
ImageIO.write(image,“jpeg”,new File(“D:\1.6Slide-”+ (i+1) +".jpg"));
}

catch(IOException e){}
}

If the issue persists then please share with us the system specifications on your end so that we may investigate it further to help you out.

Best Regards,

This code is also generating the same exception.

I have attached an image for my system specification but this is appearing on server as well which has much better specification.

Attaching another ppt which has only 2 slides but it produces the same error.

Hi Fahad,


I have observed your comments and like to share with you that I am unable to reproduce the issue with this file as well and thumbnails are being generated on my end. I have attached generated output files for your kind reference. I request you to please try increasing the heap size on your end and then try generating the thumbnails.

If the issue persists then please share with us the environment details as well so that we may investigate it further to help you out.

Best Regards,

What version are you using for Aspose Slides. Here it is happening on every machine and on server.

We have also purchased licence but is it appearing due to some other factor?

Has it been reported before?


Hi Fahad,


I have observed your comments and like to share with you that I am unable to reproduce this issue using Aspose.Slides for Java 15.9.0 with JDK 1.8 and Windows 10 on my end. Please share with us Operating System details, Java details and Application details on your end so that we may investigate it further to help you out.

About your question for past of this issue, An issue issue like this has never been reported.

Best Regards,

In the .NET aspose area, I found the below issues which exactly I am facing:


Aspose.Imaging is not working on larger Images
Aspose.Imaging is not working on larger Images

Can you point me to the location of the jar you are using?

Hi Fahad,


I have observed your comments and like to request you to please try using Aspose.Slides for Java 15.9.0 on your end to serve the purpose.

Please let us know if the issue persists. We will be happy to assist you further.

Best Regards,

Thank you. We were using aspose.slides-15.4.0 which was the culprit.

The issue is not appearing with the jar you shared.
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>

Hi Fahad,


Thank you for your valuable feedback.

We are glad to know that your issue is resolved and things have started working on your end.

Please feel free to contact us if we could be of any help to you.

Best Regards,