I am evaluating Apsose.Slides for Java (version 20.8) as a possible replacement for using Apache POI and am running into a bug trying to generate thumbnails from the slides. If I use Presentation.getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting,
int[] slides,
float scaleX,
float scaleY)
in order to create thumbnails for part of a presentation, it returns an array containing a thumbnail for ALL slides in the presentation, not just the ones in the slides array. I also noticed that it takes approximately the same time to convert a single slide using ISlide.getThumbnail(…) as it does to convert all slides in the presentation to thumbnails. Note: if you call ISlide.getThumbnail() with no parameters it takes significantly less time than if you try and scale the image.
Test Code to reproduce:
@Test
public void slide2ImagePartial() throws Exception {
InputStream isPPT1 = getClass().getResourceAsStream("/test6.pptx");
Presentation ppt1 = new Presentation(isPPT1);
int half = ppt1.getSlides().size()/2;
int[] slides = new int[half];
for(int i=0;i<half;i++) {
slides[i]=i;
}
long start = System.currentTimeMillis();
BufferedImage[] thumbnails = ppt1.getThumbnails(null,slides,0.25f,.25f);
long end = System.currentTimeMillis();
System.out.println(“Converted half of the presentation to thumbnails in " + (end-start) + " ms”);
assertEquals(“Wrong number of thumbnails generated”, half, thumbnails.length);
}