Inconsistent parsing of XBM files after JDK-8361748

XMLWordPrintable

    • 2d
    • Fix Understood
    • b05
    • 27

      JDK-8361748 and JDK-8373727 changed how XBM files are parsed.

      For example,

      #define ht 1
      #define th 8
      k[] = {0xAB};

      is parsed as 1×8 instead of 8×1 after JDK-8361748.

      The above problem is addressed by JDK-8373727. However, the code to differentiate between width and height differs from the original code that was used before JDK-8361748. Due to this difference,

      #define ht 1
      #define h 8

      is rejected: Invalid values for width or height. Previously, `-h` was a marker for the width, and `-ht` was for height. [1]

      But JDK-8373727 uses `-th` for width and `-t` for height [2]. For backward compatibility, we should revert to `-h` and `-ht`.

      [1] https://github.com/openjdk/jdk/blob/fc807d0914c4d8d2a174410a35acf3520ff4e60a/src/java.desktop/share/classes/sun/awt/image/XbmImageDecoder.java#L109-L112
      [2] https://github.com/openjdk/jdk/blob/7f707ba8e746d859ac171d71ef8f731953a92e6a/src/java.desktop/share/classes/sun/awt/image/XbmImageDecoder.java#L114-L118

            Assignee:
            Alexey Ivanov
            Reporter:
            Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: