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 2013/08/23 22:23:58 UTC

[Bug 55476] New: After XWPFRun.addPicture() Word considers the document as corrupted

https://issues.apache.org/bugzilla/show_bug.cgi?id=55476

            Bug ID: 55476
           Summary: After XWPFRun.addPicture() Word considers the document
                    as corrupted
           Product: POI
           Version: 3.10-dev
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: dev@poi.apache.org
          Reporter: Dmitry.Romanov@gmail.com

Created attachment 30758
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30758&action=edit
the 2-lines patch to XWPFRun which solves the problem of adding images to docx
document using XWPFDocument

If you try to add a picture to XWPFDocument:

XWPFDocument document = new
XWPFDocument().createParagraph().createRun().addPicture(pictureIn,
Document.PICTURE_TYPE_JPEG, "test.jpg", Units.toEMU(300), Units.toEMU(100));

and then will save it using:

document.write(outputStream);

Microsoft Word won't open such file saying that it is corrupted.
There is discussion which touches this issue as well in comments in:
https://issues.apache.org/bugzilla/show_bug.cgi?id=49765

In particular the root cause is mentioned here:
https://issues.apache.org/bugzilla/show_bug.cgi?id=49765#c14

I'm attaching the patch which resolves the issue.

-- 
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 55476] [PATCH] Fixed: after XWPFRun.addPicture() Word considers the document as corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55476

theodor_willax@hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |theodor_willax@hotmail.com

-- 
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 55476] After XWPFRun.addPicture() Word considers the document as corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55476

Didier Fetter <di...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED

--- Comment #3 from Didier Fetter <di...@free.fr> ---
Sorry, I don't exactly know how the patches are supposed to be submitted to SVN
or notified to committers. In the guidelines they just say "set the subject to
[PATCH] followed by a brief description", maybe this is what we should do.
Please tell me if I should change the status back.
But I think this patch should be committed soon because this issue has been
reported several times in forums and in this database.

-- 
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 55476] After XWPFRun.addPicture() Word considers the document as corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55476

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|VERIFIED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #4 from Dominik Stadler <do...@gmx.at> ---
reponening this issue then as it is not commited yet

-- 
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 55476] After XWPFRun.addPicture() Word considers the document as corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55476

Didier Fetter <di...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 OS|                            |All

--- Comment #1 from Didier Fetter <di...@free.fr> ---
I've tested the patch (I had just made one of my own). It works fine, the
pic:pic tag is not empty anymore.

-- 
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 55476] [PATCH] Fixed: after XWPFRun.addPicture() Word considers the document as corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55476

Dmitry Romanov <Dm...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|After XWPFRun.addPicture()  |[PATCH] Fixed: after
                   |Word considers the document |XWPFRun.addPicture() Word
                   |as corrupted                |considers the document as
                   |                            |corrupted

-- 
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 55476] After XWPFRun.addPicture() Word considers the document as corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55476

--- Comment #2 from Dmitry Romanov <Dm...@gmail.com> ---
Didier,
I see you marked the bug as RESOLVED/FIXED but I can't see the change in SVN at
least in the trunk
When would we expect committing the patch to SVN?

-- 
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 55476] [PATCH] Fixed: after XWPFRun.addPicture() Word considers the document as corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55476

mengxi <y6...@163.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW
            Version|3.10-dev                    |3.11-dev

--- Comment #5 from mengxi <y6...@163.com> ---
我的也是这个问题

-- 
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