diff options
author | Nick Burch <nick@apache.org> | 2010-09-09 09:28:04 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2010-09-09 09:28:04 +0000 |
commit | 8d475c729d0a78b8039ef684f653e65076d384d4 (patch) | |
tree | 9725745cfcdd11b10d46d7a5aa98e36797f5e7aa /src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java | |
parent | 6d0d44d0aadf7cbdd9f7047e928449a70bbd428b (diff) | |
download | poi-8d475c729d0a78b8039ef684f653e65076d384d4.tar.gz poi-8d475c729d0a78b8039ef684f653e65076d384d4.zip |
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
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java | 2 |
1 files changed, 2 insertions, 0 deletions
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 } |