On Tue, 17 Feb 2026 21:41:24 GMT, Alexey Ivanov <[email protected]> wrote:
> [JDK-8361748](https://bugs.openjdk.org/browse/JDK-8361748 "Enforce limits on > the size of an XBM image") and > [JDK-8373727](https://bugs.openjdk.org/browse/JDK-8373727 "New XBM images > parser regression: only the first line of the bitmap array is parsed") > changed how XBM files are parsed, and now some of the valid XBM images are > parsed inconsistently. For example, > > > #define ht 1 > #define th 8 > k[] = {0xAB}; > > > is parsed as image of size 1×8 instead of 8×1 after JDK-8361748. > > The above problem is addressed by > [JDK-8373727](https://bugs.openjdk.org/browse/JDK-8373727). However, the code > to differentiate between width and height differs from the original code that > was used before [JDK-8361748](https://bugs.openjdk.org/browse/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 width, and `-ht` was for height. > > https://github.com/openjdk/jdk/blob/fc807d0914c4d8d2a174410a35acf3520ff4e60a/src/java.desktop/share/classes/sun/awt/image/XbmImageDecoder.java#L109-L112 > > But [JDK-8373727](https://bugs.openjdk.org/browse/JDK-8373727) uses `-th` for > width and `-t` for height. > > https://github.com/openjdk/jdk/blob/7f707ba8e746d859ac171d71ef8f731953a92e6a/src/java.desktop/share/classes/sun/awt/image/XbmImageDecoder.java#L114-L118 > > For backward compatibility, we should revert to `-h` and `-ht`. Looks like you're covering all the possible width/height combinations which is nice. Should we add one with just a bitmap line (no #define width/height lines at all)? Reverting the width/height parsing to "ht" and "h" looks good to me. ------------- Marked as reviewed by dnguyen (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/29769#pullrequestreview-3833943359
