RFR: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag

Sergey Bylokhov-2
The root cause is using the wrong endian, the ICC profile uses big-endian notation. We even have special methods to convert the data, but for some reason, their usage was dropped in the JDK-6523398.

-------------

Commit messages:
 - test update
 - reformat
 - use built-in AdjustEndiannessXX
 - Initial version

Changes: https://git.openjdk.java.net/jdk/pull/3037/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3037&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8263622
  Stats: 132 lines in 2 files changed: 88 ins; 35 del; 9 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3037.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3037/head:pull/3037

PR: https://git.openjdk.java.net/jdk/pull/3037
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag

Sergey Bylokhov-2
On Tue, 16 Mar 2021 20:08:59 GMT, Sergey Bylokhov <[hidden email]> wrote:

> The root cause is using the wrong endian, the ICC profile uses big-endian notation. We even have special methods to convert the data, but for some reason, their usage was dropped in the JDK-6523398.

src/java.desktop/share/native/liblcms/LCMS.c line 46:

> 44:                 ((int) SigMake ((a), (b), (c), (d)))
> 45:
> 46: #define SigHead TagIdConst('h','e','a','d')

The logic of this method is the same as _cmsAdjustEndianess32 from the "lcms2_plugin.h"
https://github.com/openjdk/jdk/blob/9cb9af68659eaa60c9523c23a85ea37af57a5280/src/java.desktop/share/native/liblcms/cmsplugin.c#L87

-------------

PR: https://git.openjdk.java.net/jdk/pull/3037
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag

Alexander Zvegintsev-2
In reply to this post by Sergey Bylokhov-2
On Tue, 16 Mar 2021 20:08:59 GMT, Sergey Bylokhov <[hidden email]> wrote:

> The root cause is using the wrong endian, the ICC profile uses big-endian notation. We even have special methods to convert the data, but for some reason, their usage was dropped in the JDK-6523398.

Marked as reviewed by azvegint (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/3037
Reply | Threaded
Open this post in threaded view
|

Integrated: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag

Sergey Bylokhov-2
In reply to this post by Sergey Bylokhov-2
On Tue, 16 Mar 2021 20:08:59 GMT, Sergey Bylokhov <[hidden email]> wrote:

> The root cause is using the wrong endian, the ICC profile uses big-endian notation. We even have special methods to convert the data, but for some reason, their usage was dropped in the JDK-6523398.

This pull request has now been integrated.

Changeset: 01ddf3d2
Author:    Sergey Bylokhov <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/01ddf3d2
Stats:     132 lines in 2 files changed: 88 ins; 35 del; 9 mod

8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag

Reviewed-by: azvegint

-------------

PR: https://git.openjdk.java.net/jdk/pull/3037