Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-1170

[PATCH] Workaround for incorrect ColorConvertOp alpha handling breaks masking

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.8
    • None
    • None
    • None

    Description

      There is workaround in Any2LumRed.java with this comment:
      // All this nonsense is to work around the fact that the
      // Color convert op doesn't properly copy the Alpha from
      // src to dst.

      When processing SVG with mask in Oracle JDK 8, this workaround is the root cause of several issues reported here in JIRA.

      The only related issue I've found so far is https://bugs.openjdk.java.net/browse/JDK-8005930. Can anybody confirm the comment/workaround above was targeted for OpenJDK?

      When this code is commented, the result is processed correctly (Oracle JDK). However, I am afraid this is not a proper way how to fix it as this code should produce same results for various JDKs/versions. For this we need a new boolean variable, something like isColorConvertOpAlphaSupported - the result of analyzing destination's alpha (if present or not) after running the simple ColorConvertOp test. That workaround would be applied only if alpha is not supported.

      Attachments

        1. BATIK-1170.patch
          7 kB
          Jan Tošovský
        2. ring_mask_after.png
          8 kB
          Jan Tošovský
        3. ring_mask_before.png
          4 kB
          Jan Tošovský
        4. ring_mask.svg
          1 kB
          Jan Tošovský

        Issue Links

          Activity

            People

              ssteiner Simon Steiner
              jan.tosovsky.cz Jan Tošovský
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: