Bug 1197

Summary: Texture and image API revamping
Product: [JogAmp] Jogl Reporter: Julien Gouesse <gouessej>
Component: utilAssignee: Sven Gothel <sgothel>
Status: UNCONFIRMED ---    
Severity: enhancement CC: gouessej
Priority: P5    
Version: tbd   
Hardware: All   
OS: all   
Workaround: ---

Description Julien Gouesse 2015-08-20 17:23:55 CEST
com.jogamp.opengl.util.texture.ImageType should be used to represent the image type in several places in the API, in TextureIO and internally.

ImageType should contain the extensions of the image format. There isn't always a 1 to 1 match between the "file suffix" and the image type. For example, the files in JPEG format can use several filename extensions:
.jpg, .jpeg, .jpe, .jif, .jfif, .jfi

"(fileSuffix == null) ? IOUtil.getFileSuffix(file) : fileSuffix;" should be used in TextureIO in order to get the file suffix consistently and drive the input parameter final instead of modifying an input.

The interface TextureWriter supports only the writing of a single TextureData instance into a single file whereas some image format supports containing multiple images in a single file, for example ICNS and ICO. Another interface could be created or TextureWriter should be modified.

Maybe a conversion tool could be added into TextureIO. TextureIO has numerous readers and writers. An Ant task could be useful too (mine was refused in Apache Commons Imaging). This last feature might be moved into a separate bug report if it goes beyond the objectives of the version 2.4.