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 2014/08/04 18:00:16 UTC
[Bug 56812] New: XSLFPictureData reference to linked picture file
https://issues.apache.org/bugzilla/show_bug.cgi?id=56812
Bug ID: 56812
Summary: XSLFPictureData reference to linked picture file
Product: POI
Version: unspecified
Hardware: Macintosh
Status: NEW
Severity: normal
Priority: P2
Component: XSLF
Assignee: dev@poi.apache.org
Reporter: geoff@wrightville.org
Created attachment 31873
--> https://issues.apache.org/bugzilla/attachment.cgi?id=31873&action=edit
Powerpoint file with three pictures. First picture is embedded, second picture
is linked and embedded, third picture is only linked.
When adding a picture to a PowerPoint presentation, you can embed the file or
link to it. The embedded filename can be accessed using:
XSLFPictureData data = ((XSLFPictureShape) shape).getPictureData();
System.out.println(data.getFileName());
output:
org.apache.poi.xslf.usermodel.XSLFPictureShape@654df764
image7.png
However, when the picture is not embedded but inserted only as a "link to
file", there is no data available and the above code produces a null pointer
exception.
Is it possible to add a reference to the linked picture file ?
--
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 56812] XSLFPictureData reference to linked picture file
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56812
Nick Burch <ap...@gagravarr.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Nick Burch <ap...@gagravarr.org> ---
Fixed in r1615812.
XSLFPictureShape now provides a method isExternalLinkedPicture(), which lets
you check if it'll have a picture data or not. If not, you can use
getPictureLink() to get the URI of the externally linked image.
(You can't get a XSLFPictureData as the data isn't in the pptx file)
--
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 56812] XSLFPictureData reference to linked picture file
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56812
Geoff Wright <ge...@wrightville.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |geoff@wrightville.org
--- Comment #1 from Geoff Wright <ge...@wrightville.org> ---
Created attachment 31874
--> https://issues.apache.org/bugzilla/attachment.cgi?id=31874&action=edit
Code to demonstrate null pointer error when picture is only linked (third
picture in attached Powerpoint file).
The third picture in the referenced Powerpoint file is a linked picture (not
embedded). data.getFilename() returns a null pointer exception but it would be
useful if it returned the name of the linked picture file.
--
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 56812] XSLFPictureData reference to linked picture file
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56812
Nick Burch <ap...@gagravarr.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #2 from Nick Burch <ap...@gagravarr.org> ---
Thanks for this, I've used it to add a disabled unit test in r1615803.
--
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