]> source.dussan.org Git - poi.git/commitdiff
Patch from Stefan from bug #51172 - XWPF .gif images support
authorNick Burch <nick@apache.org>
Fri, 13 May 2011 11:06:18 +0000 (11:06 +0000)
committerNick Burch <nick@apache.org>
Fri, 13 May 2011 11:06:18 +0000 (11:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1102668 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java

index db3adb4e1b50e0680b3fc70ec946eba7c546874c..ad97b96946b19083731218aff9959357dcfb72c1 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta3" date="2011-??-??">
+           <action dev="poi-developers" type="add">51172 - Add XWPF support for GIF pictures</action>
            <action dev="poi-developers" type="add">NPOIFS Mini Streams now support extending the underlying big block stream to fit more data</action>
            <action dev="poi-developers" type="fix">51148 - XWPFDocument now properly tracks paragraphs and tables when adding/removing them</action>
            <action dev="poi-developers" type="fix">51153 - Correct sizing of LbsDataSubRecord with unused padding fields</action>
index 2c3d4f732ac387c9f3866216204e7ef15c53b20c..cf051e4516b360ee9ddedba757dd1981524aa6b8 100644 (file)
@@ -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;
        
 }
index ecae82b3fa851734667c9f8699157a2cf20fbfff..aee464e0e397eeba9c829e135dde9947578acecd 100644 (file)
@@ -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
index 83d2282099cfdcb44db832a24587c0884d792f65..14783d62f7921ce4fa9cef138e18faf50ded4da1 100644 (file)
@@ -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",