Bug 50281

Summary: When add a new image in a sheet with image corrupts the file
Product: POI Reporter: Matheus Bastos <mtheus>
Component: HSSFAssignee: POI Developers List <dev>
Severity: critical CC: shafiexp
Priority: P2    
Version: 3.7-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Files to reproduce

Description Matheus Bastos 2010-11-16 15:12:02 UTC
Created attachment 26303 [details]
Files to reproduce

I changed the POI image example to load an excel document with an image to add a new image in the same file. Excel 2007 or 2010 shows a corruption message. In attachment contains error-print.jpg, ImageTest.java and picture-template.xls the files needs to reproduce the problem.
Comment 1 Nick Burch 2010-11-17 08:09:04 UTC
Adding pictures to a sheet that already has them is not supported in HSSF. (This is mentioned on the website in the section on adding images)

You either need to add all your images in one go, or use XSSF

Or, send in patches to improve this area of HSSF :)