Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-28882

PNG to DefineBitsJPEG3 will change color(bug in LosslessImageTranscoder)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Adobe Flex SDK Previous
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Affected OS(s): Windows
      Affected OS(s): Windows 7
      Language Found: English

      Description

      Steps to reproduce:
      1.Produce a color picture 0x7F0050FF
      2.[Embed(source="test.png", mimeType="image/png", compression="true", quality="100")]
      3.Instantiated and getPixel32

      Actual Results:
      7f0064ff

      Expected Results:
      7f0030ff

      Workaround (if any):

      result:
      fix bug in class "flex2.compiler.media.LosslessImageTranscoder"

      change code in line 82:

      int[] pixels = image.getPixels();
      for (int i = 0; i < imageSize; ++i)

      { int alpha = (pixels[i] >> 24) & 0xff; int r = (pixels[i] >> 16) & 0xff; int g = (pixels[i] >> 8) & 0xff; int b = pixels[i] & 0xff; r = ((r * alpha) / 0xff) & 0xff; g = ((g * alpha) / 0xff) & 0xff; b = ((b * alpha) / 0xff) & 0xff; pixels[i] = (0xff<<24)|(r<<16)|(g<<8)|b; alphaData[i] = (byte) (alpha); }

      BufferedImage bufferedImage = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adobejira Adobe JIRA
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: