Bug 56467

Summary: [PATCH] cloneSheet() does not properly copy pictures
Product: POI Reporter: Alessandro Guarascio <guarale>
Component: XSSFAssignee: POI Developers List <dev>
Severity: normal Keywords: PatchAvailable
Priority: P2    
Version: 3.10-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Here is a proposed patch for XSSFWorkbook.java
Patch for XSSFWorkbook.java

Description Alessandro Guarascio 2014-04-28 14:15:52 UTC
After cloning an XSSFSheet with XSSFWorkbook.cloneSheet() method, pictures are not properly copied in the cloned sheet.

e.g. the following 

Drawing drawing = sheet.createDrawingPatriarch();
for (XSSFShape shape : ((XSSFDrawing) drawing).getShapes()) {
    if (shape instanceof XSSFPicture) {
        XSSFPictureData pictureData = ((XSSFPicture) shape).getPictureData();
        // ...

pictureData is null after assignment.
Comment 1 Alessandro Guarascio 2014-04-29 12:04:48 UTC
Created attachment 31570 [details]
Here is a proposed patch for XSSFWorkbook.java
Comment 2 Alessandro Guarascio 2014-04-29 15:34:01 UTC
Created attachment 31574 [details]
Patch for XSSFWorkbook.java

Sorry, ignore the previous attachment which did not create a consistent XSLX file once saved.
Comment 3 Dominik Stadler 2015-03-11 18:25:48 UTC
Applied with r1665959 for inclusion in release 3.12, thanks for providing the patch!
Comment 4 Carol Loomis 2019-02-15 07:05:03 UTC
Is it possible to read the XLS file with Apache POI? XSSFWorkbook may be the reason my code is not working. I'm looking for the options to get the XSSF library at https://www.writemyessayfast.org/write-my-essay-in-6-hours.php projects.