poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49423] New: Data got lost when trying to get EscherContainerRecord
Date Thu, 10 Jun 2010 16:26:18 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49423

           Summary: Data got lost when trying to get EscherContainerRecord
           Product: POI
           Version: 3.5-FINAL
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: POI Overall
        AssignedTo: dev@poi.apache.org
        ReportedBy: jiangpeng.shi@utsouthwestern.edu


One of my project need to read images from an excel file (.xls). Besides
reading out the image data, I also need to read out the image position (row and
column) from excel file. During this process, I found there is a bug when I
tried to get EscherContainerRecord. 
Here was my plan: I tried to read EscherAggregate from HSSFSheet, and then From
EscherAggreage, I retrieved a list of the EscherRecord. By going though this
list of EscherRecord, and their children, I can get EscherClientAnchorRecord
which contains row number and column number. 

But every time if I process a file which has around 50+ or 60+ images, I got an
warning: 
 WARNING: xxxx bytes remaining but no space left
 WARNING: xxxx bytes remaining but no space left

And from the output, I can see there are only about 30+
EscherClientAnchorRecord are retrieved. I believe that EscherClientAnchorRecord
is a child of EscherContainerRecord this this case, and the process of creating
this EscherContainerRecord get some problems. I checked around the source code,
and found the only place where create this warning message is in class : 
org/apache/poi/ddf/EscherContainerRecord.java: with following method:
  public int fillFields(byte[] data, int pOffset, EscherRecordFactory
recordFactory) {
        int bytesRemaining = readHeader(data, pOffset);
        int bytesWritten = 8;
        int offset = pOffset + 8;
        while (bytesRemaining > 0 && offset < data.length) {
            EscherRecord child = recordFactory.createRecord(data, offset);
            int childBytesWritten = child.fillFields(data, offset,
recordFactory);
            bytesWritten += childBytesWritten;
            offset += childBytesWritten;
            bytesRemaining -= childBytesWritten;
            addChildRecord(child);
            if (offset >= data.length && bytesRemaining > 0) {
                System.out.println("WARNING: " + bytesRemaining + " bytes
remaining but no space left");
            }
        }
        return bytesWritten;
    }

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message