Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-2616

<s:transformImageSize> fills transparent areas with white background

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0.GA
    • Fix Version/s: The future
    • Component/s: JSF Controls
    • Labels:
      None
    • Environment:

      Windows, Jboss 4.2.1, Facelets

      Description

      if a png-image containing transparent areas is scaled, the transparent areas get filled with white color.

      I created my own transformImageSize-component which works properly.
      Its applyTransformation method looks like that:

      <code>
      public void applyTransform(Image image) throws IOException

      { ........... BufferedImage in = image.getBufferedImage(); GraphicsConfiguration gc = in.createGraphics().getDeviceConfiguration(); BufferedImage out = gc.createCompatibleImage(scaledWidth, scaledHeight, Transparency.BITMASK); Graphics2D g2d = out.createGraphics(); g2d.setComposite(AlphaComposite.Src); g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); g2d.drawImage(in, 0, 0, scaledWidth, scaledHeight, null); g2d.dispose(); image.setBufferedImage(out); }

      </code>

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                pmuir Pete Muir
                Reporter:
                mangri3000 Manfred Griesser
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: