From 8d475c729d0a78b8039ef684f653e65076d384d4 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 9 Sep 2010 09:28:04 +0000 Subject: Add getMimeType() method to HSSF/XSSF PictureData, alongside existing file extension git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@995360 13f79535-47bb-0310-9956-ffa450edef68 --- src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/testcases/org/apache/poi/hssf') diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java index eb7d12ebf5..e351e26690 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java @@ -57,6 +57,7 @@ public final class TestHSSFPictureData extends TestCase{ assertEquals(192, jpg.getWidth()); assertEquals(176, jpg.getHeight()); assertEquals(HSSFWorkbook.PICTURE_TYPE_JPEG, pict.getFormat()); + assertEquals("image/jpeg", pict.getMimeType()); } else if (ext.equals("png")){ //try to read image data using javax.imageio.* (JDK 1.4+) BufferedImage png = ImageIO.read(new ByteArrayInputStream(data)); @@ -64,6 +65,7 @@ public final class TestHSSFPictureData extends TestCase{ assertEquals(300, png.getWidth()); assertEquals(300, png.getHeight()); assertEquals(HSSFWorkbook.PICTURE_TYPE_PNG, pict.getFormat()); + assertEquals("image/png", pict.getMimeType()); } else { //TODO: test code for PICT, WMF and EMF } -- cgit v1.2.3