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

Scaling a image results in bottom and left pixel missing

    XMLWordPrintable

    Details

      Description

      FULL PRODUCT VERSION :
      1.7.0_51-b13

      ADDITIONAL OS VERSION INFORMATION :
      All tested (Suse linux 12 ,windows 8)

      A DESCRIPTION OF THE PROBLEM :
      When performing SubsampleAverage scale transformation the bottom and right lines in source image are lost.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a white image with a black border 1px.
      Scale it down. Resulted image will miss the border on bottom and right sides.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The border should be present (antialias or not, interpolated or not)
      ACTUAL -
      border is missing

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      ParameterBlock pb = new ParameterBlock();
      pb.addSource(image);
      pb.add(scaleFactor); // x scaleFactor
      pb.add(scaleFactor); // y scalefactor
      pb.add(0.0F); // x translation
      pb.add(0.0F); // y translation
      pb.add(new InterpolationBicubic2(2));

      Map<RenderingHints.Key, Object> quality = new HashMap<RenderingHints.Key, Object>();
      quality.put(RenderingHints.KEY_ANTIALIASING,
      RenderingHints.VALUE_ANTIALIAS_ON);
      quality.put(RenderingHints.KEY_COLOR_RENDERING,
      RenderingHints.VALUE_COLOR_RENDER_QUALITY);
      quality.put(RenderingHints.KEY_RENDERING,
      RenderingHints.VALUE_RENDER_QUALITY);
      RenderingHints hints = new RenderingHints(quality);

      image = JAI.create("SubsampleAverage", pb, hints);
      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: