Extraindo imagens do pptx com apache poi

Estou tentando extrair slides de umppt arquivo com o Apache POI, não há problema nisso, mas agora pretendo abrirpptx arquivos e faça o mesmo, alguém sabe como fazer ??

este é o código para extrair imagens deppt arquivos:

public ImageIcon display() throws JPresentationException { 

    Background background; 
    background = slides[current].getBackground(); 
    Fill f = background.getFill(); 
    Color color = f.getForegroundColor(); 
    Dimension dimension = ppt.getPageSize(); 
    shapes = slides[current].getShapes(); 
    BufferedImage img = new BufferedImage(dimension.width, dimension.height, BufferedImage.TYPE_INT_RGB); 
    Graphics2D graphics = img.createGraphics(); 
    graphics.setPaint(color); 
    graphics.fill(new Rectangle2D.Float(0, 0, dimension.width, dimension.height)); 
    slides[current].draw(graphics); 
    ImageIcon icon = new ImageIcon(img); 

    return icon; 
}

questionAnswers(2)

yourAnswerToTheQuestion