Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8245271

com.sun.imageio.plugins.bmp.BMPImageWriter, encodeRLE4 function Padding bug

    Details

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Not operating system related

      A DESCRIPTION OF THE PROBLEM :
      In the class com.sun.imageio.plugins.bmp.BMPImageWriter, the encodeRLE4 function is not working as expected.

      The line 1105 :
      if ( !isEven((int)Math.ceil((absVal-1)/2)) )
      should be :
      if ( !isEven((int)Math.ceil((absVal-1)/(double)2)) ) {

      Same for line 1241.

      The bug causes output artifacts on certain images.


      CUSTOMER SUBMITTED WORKAROUND :
      Copy the BMPImageWriter class and fix the code to get it working.

      FREQUENCY : always


        Attachments

        1. input.bmp
          input.bmp
          38 kB
        2. Jay_upload.png
          Jay_upload.png
          285 kB
        3. Main.java
          1 kB
        4. output.bmp
          output.bmp
          11 kB

          Activity

            People

            • Assignee:
              jdv Jayathirth D V
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: