]> source.dussan.org Git - poi.git/commitdiff
Tweak hssf and hwpf image mime types for wmf/emf to match those used by XSSF/XWPF
authorNick Burch <nick@apache.org>
Fri, 10 Sep 2010 19:15:16 +0000 (19:15 +0000)
committerNick Burch <nick@apache.org>
Fri, 10 Sep 2010 19:15:16 +0000 (19:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@995943 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java
src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java
src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java

index d8467b8c323bbde519bb6617c849ee79689480a4..0516cccf6bb5157b9407c4ba01f6cf07be9a2526 100644 (file)
@@ -106,9 +106,9 @@ public class HSSFPictureData implements PictureData
     public String getMimeType() {
        switch (blip.getRecordId()) {
            case EscherMetafileBlip.RECORD_ID_WMF:
-               return "application/x-wmf";
+               return "image/x-wmf";
            case EscherMetafileBlip.RECORD_ID_EMF:
-               return "application/x-emf";
+               return "image/x-emf";
            case EscherMetafileBlip.RECORD_ID_PICT:
                return "image/x-pict";
            case EscherBitmapBlip.RECORD_ID_PNG:
index dcdd8d3bc3beae96e30d672637ff805fe34e4ecb..481bd556e113c8acecc44684f9ed80cf8f698021 100644 (file)
@@ -236,10 +236,10 @@ public final class Picture
         return "image/tiff";
      }
      if("wmf".equals(extension)) {
-        return "application/x-wmf";
+        return "image/x-wmf";
      }
      if("emf".equals(extension)) {
-        return "application/x-emf";
+        return "image/x-emf";
      }
      return "image/unknown";
   }
index 946cccbcbf5532e50de2fd562aef0aa2283aaf35..ee34f4b724116dcc8e68b1ea1ce549a33bc8cc19 100644 (file)
@@ -79,7 +79,7 @@ public final class TestPictures extends TestCase {
                assertEquals("png", pics.get(4).suggestFileExtension());
       assertEquals("image/png", pics.get(4).getMimeType());
                assertEquals("wmf", pics.get(5).suggestFileExtension());
-      assertEquals("application/x-wmf", pics.get(5).getMimeType());
+      assertEquals("image/x-wmf", pics.get(5).getMimeType());
                assertEquals("jpg", pics.get(6).suggestFileExtension());
       assertEquals("image/jpeg", pics.get(6).getMimeType());
        }