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

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

XMLWordPrintable

      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


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

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

              Created:
              Updated: