From ea9dd06f19284c3ce1f3f109606dd95f89fc1271 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sun, 26 Mar 2006 16:21:08 +0000 Subject: [PATCH] Tests for patches from Yegor (Bug #39097) git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@388921 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hslf/data/clock.jpg | Bin 0 -> 11988 bytes .../org/apache/poi/hslf/data/painting.png | Bin 0 -> 2112 bytes .../poi/hslf/usermodel/TestPictures.java | 58 ++++++++++++++++-- 3 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 src/scratchpad/testcases/org/apache/poi/hslf/data/clock.jpg create mode 100644 src/scratchpad/testcases/org/apache/poi/hslf/data/painting.png diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/data/clock.jpg b/src/scratchpad/testcases/org/apache/poi/hslf/data/clock.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5f05e42eacd94ea9a4471c2bd9d5f0d7c9d35966 GIT binary patch literal 11988 zcmbulbx@p9(n0naA@dUkMKdR_&D0+9aC3Hkpcl>bTpEsl(Y^n$)z{}cE>eR=Ky z;9~-606i#3_yA;lBout4=K(K}ADC$Hc(GMgkzA{V&i<*e@VD z2Id<85()}33OWip`iuCB;C}!B{tHCMOYm1#%bXB1pPtAqIH8sSt9N>fPmY)b?9TYs zf?ojt#omi73NkA4i;e$C0`OmC>3Gp(wFt}!(cS2S6ZnYoYkTFuGsKvGr_bvc_(?F_ zLlO(*wFRD60IyJxUc5)a2S@`RA2dV%Zy79xFQ0FLhy~XT4l)-y2H~D=#VEr$R$sXC5#ueIm+a;Y<2t zm#C}4PAxD?pFPM}q3s_(inhV4#*bw*P1}ZXtF0c)K|NY`rxfJUmF^sIl1)dSsZ)q+ zh1U?Qm7QLKU8rsPVg7U>>lv^nog;j$b(V9I+%O^g2jhfx=IMyRJ?^6k;b>yg$b%nt zq9{Jw*Vfl_p&d!T#r@gMtw4kC2E~Z*7{FMeGnh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slf/usermodel/TestPictures.java index d40ed0eb93..b4503eb017 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java @@ -17,11 +17,19 @@ package org.apache.poi.hslf.usermodel; import org.apache.poi.hslf.*; +import org.apache.poi.hslf.usermodel.PictureData; +import org.apache.poi.hslf.usermodel.SlideShow; +import org.apache.poi.hslf.model.Slide; +import org.apache.poi.hslf.model.Shape; +import org.apache.poi.hslf.model.Picture; +import org.apache.poi.util.LittleEndian; import junit.framework.TestCase; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; /** * Test extracting images from a ppt file @@ -29,19 +37,61 @@ import java.io.ByteArrayInputStream; * @author Yegor Kozlov */ public class TestPictures extends TestCase{ + public static String dirname = System.getProperty("HSLF.testdata.path"); + public static String filename = dirname + "/ppt_with_png.ppt"; - public void testPictures() throws Exception { - String dirname = System.getProperty("HSLF.testdata.path"); - String filename = dirname + "/ppt_with_png.ppt"; + public void testReadPictures() throws Exception { HSLFSlideShow ppt = new HSLFSlideShow(filename); - Picture[] pict = ppt.getPictures(); + PictureData[] pict = ppt.getPictures(); assertNotNull(pict); for (int i = 0; i < pict.length; i++) { byte[] data = pict[i].getData(); + BufferedImage img = ImageIO.read(new ByteArrayInputStream(data)); assertNotNull(img); } ppt.close(); } + + public void testSerializePictures() throws Exception { + HSLFSlideShow ppt = new HSLFSlideShow(filename); + PictureData[] pict = ppt.getPictures(); + assertNotNull(pict); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ppt.write(out); + out.close(); + + ppt = new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())); + pict = ppt.getPictures(); + assertNotNull(pict); + } + + public void testAddPictures() throws Exception { + int idx; + Slide slide; + Picture pict; + + SlideShow ppt = new SlideShow(); + + idx = ppt.addPicture(new File(dirname + "/clock.jpg"), Picture.JPEG); + slide = ppt.createSlide(); + pict = new Picture(idx); + pict.setDefaultSize(ppt); + slide.addShape(pict); + + idx = ppt.addPicture(new File(dirname + "/painting.png"), Picture.PNG); + pict = new Picture(idx); + pict.setDefaultSize(ppt); + slide.addShape(pict); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ppt.write(out); + out.close(); + + ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray()))); + assertTrue(ppt.getPictures().length == 2 ); + } + } -- 2.39.5