From: Nick Burch Date: Fri, 10 Sep 2010 19:15:16 +0000 (+0000) Subject: Tweak hssf and hwpf image mime types for wmf/emf to match those used by XSSF/XWPF X-Git-Tag: REL_3_7_BETA3~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7c17469faef8a9d7ed1e0ecb939f569ef4c7d083;p=poi.git Tweak hssf and hwpf image mime types for wmf/emf to match those used by XSSF/XWPF git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@995943 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java index d8467b8c32..0516cccf6b 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java @@ -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: diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java index dcdd8d3bc3..481bd556e1 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java @@ -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"; } diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java index 946cccbcbf..ee34f4b724 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java @@ -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()); }