diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index db3adb4e1..ad97b9694 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 51172 - Add XWPF support for GIF pictures NPOIFS Mini Streams now support extending the underlying big block stream to fit more data 51148 - XWPFDocument now properly tracks paragraphs and tables when adding/removing them 51153 - Correct sizing of LbsDataSubRecord with unused padding fields diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java index 2c3d4f732..cf051e451 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java @@ -34,5 +34,8 @@ public interface Document { /** Device independent bitmap */ public static final int PICTURE_TYPE_DIB = 7; + + /** GIF image format */ + public static final int PICTURE_TYPE_GIF = 8; } diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java index ecae82b3f..aee464e0e 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java @@ -41,13 +41,14 @@ public class XWPFPictureData extends POIXMLDocumentPart { */ protected static final POIXMLRelation[] RELATIONS; static { - RELATIONS = new POIXMLRelation[8]; + RELATIONS = new POIXMLRelation[9]; RELATIONS[Document.PICTURE_TYPE_EMF] = XWPFRelation.IMAGE_EMF; RELATIONS[Document.PICTURE_TYPE_WMF] = XWPFRelation.IMAGE_WMF; RELATIONS[Document.PICTURE_TYPE_PICT] = XWPFRelation.IMAGE_PICT; RELATIONS[Document.PICTURE_TYPE_JPEG] = XWPFRelation.IMAGE_JPEG; RELATIONS[Document.PICTURE_TYPE_PNG] = XWPFRelation.IMAGE_PNG; RELATIONS[Document.PICTURE_TYPE_DIB] = XWPFRelation.IMAGE_DIB; + RELATIONS[Document.PICTURE_TYPE_GIF] = XWPFRelation.IMAGE_GIF; } /** * Create a new XWPFGraphicData node diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java index 83d228209..14783d62f 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java @@ -162,7 +162,12 @@ public final class XWPFRelation extends POIXMLRelation { "/word/media/image#.dib", XWPFPictureData.class ); - + public static final XWPFRelation IMAGE_GIF = new XWPFRelation( + "image/gif", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", + "/word/media/image#.gif", + XWPFPictureData.class + ); public static final XWPFRelation IMAGES = new XWPFRelation( null, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",