Notes: - Misc cleanup and refactoring of the code org.apache.poi.hslf.usermodel.Picture is obsolete and goes away. Instead two new classes are used: org.apache.poi.hslf.usermodel.PictureData - holds picture data as read from Pictures OLE stream org.apache.poi.hslf.model.Picture extends Shape. - Image frame in a slide - Added default constructor to SlideShow and HSLFSlideShow to create an empty ppt file and setup its initial structure from a template file: public HSLFSlideShow() throws IOException { this(HSLFSlideShow.class.getResourceAsStream("/org/apache/poi/hslf/data/empty.ppt")); } empty.ppt is resource file and must be copied to its location by the compile script. - Support for adding pictures to a slide. Actually Picture is a subclass of Shape which holds reference to the picture data, position of the picture in the slide, etc. Use case: SlideShow ppt = new SlideShow(); slide = ppt.createSlide(); //picture is global object. It is shared across all slides. int idx = ppt.addPicture(new File("hello.jpg"), Picture.JPEG); Picture pict = new Picture(idx); pict.setDefaultSize(ppt); slide.addShape(pict); - Fixed bug with serialization of pictures. before this commit HSLFSlideShow.write skipped writing pictures and the data was lost. Now everything works right. Pictures are preserved. Regards, Yegor
Created attachment 17970 [details] patch with changes
Created attachment 17971 [details] affected sources
Looks good, thanks for this. I'll try to commit it on the weekend
Thanks, I've committed all of this
Marking as closed (should've done this a while ago)