Bug 29675 - POI 2.5 final corrupts output when starting workbook has a graphic
Summary: POI 2.5 final corrupts output when starting workbook has a graphic
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-18 15:37 UTC by Tim Schafer
Modified: 2007-01-16 01:36 UTC (History)
0 users



Attachments
An excel document that can reproduce the problem (13.50 KB, application/octet-stream)
2004-06-18 15:39 UTC, Tim Schafer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Schafer 2004-06-18 15:37:33 UTC
POI 2.5 will output a corrupt file if starting with a workbook with a graphic in it

This problem is a regression, as POI 1.5.1 final and POD 2.0 final do not
exhibit this problem
Comment 1 Tim Schafer 2004-06-18 15:39:53 UTC
Created attachment 11883 [details]
An excel document that can reproduce the problem
Comment 2 Michael Zalewski 2004-06-18 23:01:02 UTC
Try the patch I suggest on bug 28203
Comment 3 Michael Zalewski 2004-06-18 23:09:59 UTC
It's not really a regression (a re-appearance of an old bug).

It's a problem that started happening with the image support added in POI 2.5

You didn't say exactly what the problem was. But I suspect that simple code 
such as:

  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.IOException;
  public class Bug29675 {
    public static void main(String[] args) throws IOException {
      HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(
         "11883.xls"));
      workbook.write( new FileOutputStream( "11883a.xls"));
    }
  }

(which just copies the workbook through POI) would have run without errors, but 
the copied workbook 11883a.xls would not open in Excel.

If this is the case, the patch I describe fixes the problem, and this is a 
duplicate of bug 28203
Comment 4 Avik Sengupta 2007-01-16 01:36:53 UTC
Works as of 12Jan2007, Testcase added. 
http://issues.apache.org/bugzilla/show_bug.cgi?id=41366