Bugzilla – Attachment 606 Details for
Bug 982
TextureIO fails to load some Targa image files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test case for targa image
TestBug982TGAImageReadFromFile.java (text/x-java), 1.72 KB, created by
Michael
on 2014-03-09 23:30:06 CET
(
hide
)
Description:
Test case for targa image
Filename:
MIME Type:
Creator:
Michael
Created:
2014-03-09 23:30:06 CET
Size:
1.72 KB
patch
obsolete
>package com.jogamp.opengl.test.junit.jogl.util.texture; > >import java.io.File; >import java.io.FileInputStream; >import java.io.IOException; >import java.net.URISyntaxException; >import java.net.URL; >import java.net.URLConnection; >import java.nio.ByteBuffer; > >import javax.media.opengl.GL; >import javax.media.opengl.GLProfile; > >import org.junit.After; >import org.junit.Assert; >import org.junit.Before; >import org.junit.Test; > >import com.jogamp.common.util.IOUtil; >import com.jogamp.opengl.util.texture.spi.DDSImage; >import com.jogamp.opengl.util.texture.spi.TGAImage; >import com.jogamp.opengl.util.texture.spi.DDSImage.ImageInfo; > >public class TestBug982TGAImageReadFromFile { > > File testTGAImage01; > static GLProfile glp = GLProfile.getDefault(); > > @Before > public void setup() throws Throwable { > testTGAImage01 = initFile("notloaded.tga"); > } > > @After > public void teardown() { > testTGAImage01 = null; > } > > private File initFile(String filename) throws URISyntaxException { > URLConnection connection = IOUtil.getResource(getClass(), filename); > Assert.assertNotNull(connection); > URL url = connection.getURL(); > File file = new File(url.toURI()); > Assert.assertTrue(file.exists()); > return file; > } > > private void testImpl(File file) throws IOException { > TGAImage tgaImage = TGAImage.read(glp, new FileInputStream(testTGAImage01)); > Assert.assertNotNull(tgaImage); > } > > > @Test > public void test00_TGAImage_ReadFromFile () throws IOException { > testImpl(testTGAImage01); > } > > public static void main(String[] args) { > org.junit.runner.JUnitCore.main(TestBug982TGAImageReadFromFile.class.getName()); > } >}
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 982
: 606