https://issues.apache.org/bugzilla/show_bug.cgi?id=45129
Summary: Lost picture in file output after saving with POI
Product: POI
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
Created an attachment (id=22071)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=22071)
Original Input excel
I work on a xls with Excel XP and POI HSSF.
It contains 2 images.
I only open the workbook and then save it into a new xls (without any
modifications).
After that, I open the new workbook with MicroSoft Office Excel 2003
(11.8211.8172) S3, I got a message: "File error: Data may have been lost". I
click OK. The workbook is open but there is no these images in there.
Below is my code:
public static void main(String[] args) {
// TODO Auto-generated method stub
String input = args[0];
String output = args[1];
try{
POIFSFileSystem fs = new POIFSFileSystem(new
FileInputStream(input));
HSSFWorkbook workbook = new HSSFWorkbook(fs);
HSSFSheet sheet = workbook.getSheetAt(0);
HSSFPatriarch patriarch =
sheet.createDrawingPatriarch();
System.out.println("Output: "+output);
FileOutputStream fileOut = new
FileOutputStream(output);
workbook.write(fileOut);
fileOut.close();
} catch(IOException e){
System.out.println("Can't open file "+input+" or
"+output);
System.exit(1);
}
}
When I run, I got some warning messages:
WARNING: 14760 bytes remaining but no space left
WARNING: 14900 bytes remaining but no space left
WARNING: 14900 bytes remaining but no space left
What's happened ?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]