Summary: | Data got lost when trying to get EscherContainerRecord | ||
---|---|---|---|
Product: | POI | Reporter: | Jerry <jiangpeng.shi> |
Component: | POI Overall | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jiangpeng.shi, oleg.kuryan |
Priority: | P1 | ||
Version: | 3.6-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: |
Class to reproduce the problem
Test file to use to repro problem |
Description
Jerry
2010-06-10 12:26:16 UTC
Created attachment 26009 [details]
Class to reproduce the problem
Attaching java class to repro the problem
Created attachment 26010 [details]
Test file to use to repro problem
Adding test file to make it easier to repro the problem. It shoulf be passed to the attached Main.java class
Setting priority as it blocks development of the production task If this is a blocker problem for you, then you'll need to either investigate it more yourself, or pay someone who provides POI consultancy to do so for you. POI is a volunteer project! If you want to look into this yourself, you'll need to read up the Microsoft specifications on the file format, then manually decode the escher records by hand. Somewhere along the way, you'll hopefully spot the place where POI makes an incorrect assumption about one of the escher records. When you've found that, it will hopefully be quite a quick job to patch it, the hard bit is discovering where our assumptions on the file format and what actually crops up in some files differs. Hi Nick, Thx, for your comments. Just a quick question, maybe you know about another way to get image position? I believe it is commonly used task that is good to have in the POI library. HSSF provides a way to iterate over shapes and read their positions. The following code works fine to me: HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file)); int numSheets = workbook.getNumberOfSheets(); for (int i = 0; i < numSheets; i++) { HSSFSheet sheet = workbook.getSheetAt(i); List<HSSFShape> shapes = sheet.getDrawingPatriarch().getChildren(); for(HSSFShape shape : shapes){ HSSFAnchor anchor = shape.getAnchor(); if(anchor instanceof HSSFClientAnchor){ // absolute coordinates HSSFClientAnchor clientAnchor = (HSSFClientAnchor)anchor; System.out.println(clientAnchor.getRow1() + "," + clientAnchor.getRow2()); } else if (anchor instanceof HSSFChildAnchor){ // shape is grouped and the anchor is expressed in the coordinate system of the group HSSFChildAnchor childAnchor = (HSSFChildAnchor)anchor; System.out.println(childAnchor.getDy1() + "," + childAnchor.getDy2()); } } } If this code misses some images then please attach the problem file and a junit demonstrating what particular is missing. Yegor Yegor, I have to reopen it. Please, try your code with excel file that I have attached to the current issue. I got the following Warnings: WARNING: 9940 bytes remaining but no space left WARNING: 9940 bytes remaining but no space left Forgot to mention that NO image coordinates are printed out at all Seems to be fixed, I tried to reproduce this, but testing as described in the previous comments works now with the test file attached here. |