You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2016/01/05 10:04:36 UTC
[Bug 58804] New: Broken images depending on Layout options
https://bz.apache.org/bugzilla/show_bug.cgi?id=58804
Bug ID: 58804
Summary: Broken images depending on Layout options
Product: POI
Version: 3.13-FINAL
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: HWPF
Assignee: dev@poi.apache.org
Reporter: thomas.schwery@gmail.com
Created attachment 33405
--> https://bz.apache.org/bugzilla/attachment.cgi?id=33405&action=edit
Input file with 12 test pictures
If a document contains a number of images with "Layout" options different from
"Inline with text", they are missing from the output document.
Attached is a document with 12 sample images with different layouts :
- First row has 3 images "Inline with text". They are kept after save
- Second and third row have images with different text alignments Square,
Tight, Through, Top/Bottom, Behind and In front of text. These are lost after
save.
- Fourth row has the same images as first row. They are kept after save.
The Java code to reproduce the error only needs to open the file and save it,
without modifications :
HWPFDocument doc = new HWPFDocument(new FileInputStream(inFile));
FileOutputStream fos = new FileOutputStream(outFile);
doc.write(fos);
fos.close();
--
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
[Bug 58804] Broken images depending on Layout options
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58804
--- Comment #1 from thomas.schwery@gmail.com ---
Created attachment 33406
--> https://bz.apache.org/bugzilla/attachment.cgi?id=33406&action=edit
Input file with a single picture
The image is also lost if it is alone in the document.
--
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
[Bug 58804] Broken images depending on Layout options
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58804
--- Comment #2 from thomas.schwery@gmail.com ---
The following testcase illustrates the problem :
public void testImageCountLayout() throws Exception {
HWPFDocument docA =
HWPFTestDataSamples.openSampleFile("Bug58804-picture_single.doc");
ByteArrayOutputStream out = new ByteArrayOutputStream();
docA.write(out);
out.close();
HWPFDocument docB = new HWPFDocument(new
ByteArrayInputStream(out.toByteArray()));
assertNotNull(docA.getPicturesTable());
assertNotNull(docB.getPicturesTable());
PicturesTable picA = docA.getPicturesTable();
PicturesTable picB = docB.getPicturesTable();
List<Picture> picturesA = picA.getAllPictures();
List<Picture> picturesB = picB.getAllPictures();
assertEquals(1, picturesA.size());
assertEquals(1, picturesB.size());
}
In this case, the test fails because picturesB is empty where it should be 1.
--
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
[Bug 58804] Broken images depending on Layout options
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58804
--- Comment #3 from Dominik Stadler <do...@gmx.at> ---
I tried to take a look, but could not dig deep enough here, there is however
now an ignored unit test in TestPictures as of r1726681 which reproduces this
problem.
--
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