From 8631e403aa0c02c53b06819ef9b112af1885d4f7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 13 Feb 2014 01:06:31 +0100 Subject: TextureIO: Fix PNGTextureWriter Vertical-Flip, i.e. pass TextureData's getMustFlipVertically() to PNGPixelRect --- src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/com/jogamp') diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java index c29bd9af2..0f64fd007 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java @@ -1414,7 +1414,7 @@ public class TextureIO { final ByteBuffer buf = (ByteBuffer) buf0; buf.rewind(); final PNGPixelRect image = new PNGPixelRect(pixFmt, size, - 0 /* stride */, true /* isGLOriented */, buf /* pixels */, + 0 /* stride */, !data.getMustFlipVertically() /* isGLOriented */, buf /* pixels */, -1f, -1f); final OutputStream outs = new BufferedOutputStream(IOUtil.getFileOutputStream(file, true /* allowOverwrite */)); image.write(outs, true /* close */); @@ -1424,7 +1424,7 @@ public class TextureIO { buf.rewind(); final OutputStream outs = new BufferedOutputStream(IOUtil.getFileOutputStream(file, true /* allowOverwrite */)); PNGPixelRect.write(pixFmt, size, - 0 /* stride */, true /* isGLOriented */, buf /* pixels */, + 0 /* stride */, !data.getMustFlipVertically() /* isGLOriented */, buf /* pixels */, -1f, -1f, outs, true /* closeOutstream */); return true; } else { -- cgit v1.2.3