mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
LibGfx: Rename ICCHeader::profile_md5 to profile_id to match spec
This commit is contained in:
parent
cbad79fa86
commit
478bd97b25
1 changed files with 4 additions and 4 deletions
|
@ -111,7 +111,7 @@ struct ICCHeader {
|
||||||
|
|
||||||
BigEndian<u32> profile_creator;
|
BigEndian<u32> profile_creator;
|
||||||
|
|
||||||
u8 profile_md5[16];
|
u8 profile_id[16];
|
||||||
u8 reserved[28];
|
u8 reserved[28];
|
||||||
};
|
};
|
||||||
static_assert(sizeof(ICCHeader) == 128);
|
static_assert(sizeof(ICCHeader) == 128);
|
||||||
|
@ -239,15 +239,15 @@ Optional<Crypto::Hash::MD5::DigestType> parse_profile_id(ICCHeader const& header
|
||||||
// ICC v4, 7.2.18 Profile ID field
|
// ICC v4, 7.2.18 Profile ID field
|
||||||
// "A profile ID field value of zero (00h) shall indicate that a profile ID has not been calculated."
|
// "A profile ID field value of zero (00h) shall indicate that a profile ID has not been calculated."
|
||||||
bool did_calculate_profile_id = false;
|
bool did_calculate_profile_id = false;
|
||||||
for (u8 b : header.profile_md5)
|
for (u8 b : header.profile_id)
|
||||||
if (b != 0)
|
if (b != 0)
|
||||||
did_calculate_profile_id = true;
|
did_calculate_profile_id = true;
|
||||||
if (!did_calculate_profile_id)
|
if (!did_calculate_profile_id)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
Crypto::Hash::MD5::DigestType md5;
|
Crypto::Hash::MD5::DigestType md5;
|
||||||
static_assert(sizeof(md5.data) == sizeof(header.profile_md5));
|
static_assert(sizeof(md5.data) == sizeof(header.profile_id));
|
||||||
memcpy(md5.data, header.profile_md5, sizeof(md5.data));
|
memcpy(md5.data, header.profile_id, sizeof(md5.data));
|
||||||
|
|
||||||
// FIXME: Consider comparing read id with compute_id() result and failing if they aren't equal.
|
// FIXME: Consider comparing read id with compute_id() result and failing if they aren't equal.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue