ASF Bugzilla – Attachment 33973 Details for
Bug 59742
XSLFPictureData is missing TIFF support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
JUnit Test
TiffAddingTest.java (text/plain), 1.08 KB, created by
Jens Popp
on 2016-06-22 15:54:00 UTC
(
hide
)
Description:
JUnit Test
Filename:
MIME Type:
Creator:
Jens Popp
Created:
2016-06-22 15:54:00 UTC
Size:
1.08 KB
patch
obsolete
>package poiTest; > >import java.io.IOException; >import java.io.InputStream; > >import org.apache.commons.io.IOUtils; >import org.apache.poi.sl.usermodel.PictureData.PictureType; >import org.apache.poi.xslf.usermodel.XMLSlideShow; >import org.apache.poi.xslf.usermodel.XSLFPictureData; >import org.junit.Test; > >import junit.framework.TestCase; > >public class TiffAddingTest extends TestCase { > > @Test > public void testIfTiffIsSupported() { > XMLSlideShow slideShow = null; > try { > slideShow = new XMLSlideShow(); > final InputStream fileInputstream = TiffAddingTest.class.getResourceAsStream("/test.tif"); > final byte[] pictureData = IOUtils.toByteArray(fileInputstream); > IOUtils.closeQuietly(fileInputstream); > XSLFPictureData idx = slideShow.addPicture(pictureData, PictureType.TIFF); > System.out.println(idx); > assertEquals("Wrong content type", "image/tiff", idx.getContentType()); > > } catch (IllegalArgumentException e) { > fail(e.getMessage()); > } catch (IOException ex) { > fail(ex.getMessage()); > } finally { > IOUtils.closeQuietly(slideShow); > } > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 59742
:
33972
| 33973