<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>367</bug_id>
          
          <creation_ts>2009-01-28 05:58:20 +0100</creation_ts>
          <short_desc>File created by Screenshot might be flipped vertically</short_desc>
          <delta_ts>2012-09-30 21:11:24 +0200</delta_ts>
          <reporter_accessible>0</reporter_accessible>
          <cclist_accessible>0</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>awt</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>383</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:51:42 +0100</bug_when>
    <thetext>


---- Reported by gibe 2009-01-28 05:58:21 ----

When taking a screen shot using the Screenshot class, the exported image might
be flipped vertically.
Actually, it happens on Windows with GLJPanel and when pbuffers are disabled.

The problem comes from the vertical flip of the image by the Screenshot class.
Unlike the display method of the GLJPanel, the Screenshot class always performs
the flip. In the GLJPanel, before displaying the image, a check is done to know
whether the image should be flipped or not. This check obviously lacks in the
Screenshot class.



---- Additional Comments From gibe 2009-01-28 06:04:55 ----

Here is a workaround for the bug:
------------------------
// might unecessary flip the image
BufferedImage img = Screenshot.readToBufferedImage(getWidth(), getHeight());

// check if it was the case
boolean needFlip;
try {
  // raises an exception if hardware acceleration is on
  needFlip =
!((GLContextImpl)GLContext.getCurrent()).offscreenImageNeedsVerticalFlip();
} catch (GLException e) {
  // hardware acceleration is on
  needFlip = false;
}
if (needFlip) {
  // flip it back
  ImageUtil.flipImageVertically(img);
}
----------------

If you were using Screenshot.writeToFile, use the code above and
ImageIO.write(...) instead.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:51 EDT  ---

This bug was previously known as _bug_ 367 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=367
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1858</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-09-30 21:11:24 +0200</bug_when>
    <thetext>Root cause is the Windows software renderer, won&apos;t fix.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>