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. input.bmp
          38 kB
          swati sharma
        2. output.bmp
          11 kB
          swati sharma
        3. Main.java
          1 kB
          swati sharma
        4. Jay_upload.png
          285 kB
          Jayathirth D V

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

              Created:
              Updated: