Hi - we are getting an OutOfMemory issue when creating a scaled thumbnail from a slide. We are using aspose-slides v23.5
Here is a demo call that ends up in the issue. The function slide.getThumbnail() is working fine, however as we add scales slide.getThumbnail(scale, scale) we get an OOM error.
Attached you’ll find the slide and the java file as a zip.
Any ideas? Thanks!
package org.example;
import com.aspose.slides.ISlide;
import com.aspose.slides.Presentation;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
System.out.println("Hello world!");
Presentation pres = new Presentation("DimNio30_2.pptx");
try {
ISlide slide = pres.getSlides().get_Item(0);
float scale = 1.4f;
// generate Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
BufferedImage image = slide.getThumbnail(scale, scale);
// works
//BufferedImage image = slide.getThumbnail();
ImageIO.write(image, "jpeg", new File("testimage.jpg"));
} finally {
if (pres != null) pres.dispose();
}
}
}
OOM-issue-slides.zip (42.7 KB)