diff options
author | Nico Weber <thakis@chromium.org> | 2023-02-07 15:15:55 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-08 16:35:57 +0000 |
commit | 8bd64f001cde327d5c2b6f3ba90d9c31d29d8934 (patch) | |
tree | 12d1bb78fb9e6eee90be91d91ed06f160ef55981 /Userland/Utilities | |
parent | cbcf8471a625b485748764886c27012ac6786570 (diff) | |
download | serenity-8bd64f001cde327d5c2b6f3ba90d9c31d29d8934.zip |
LibGfx+icc: Read signatureType
This isn't used by any mandatory tags, and it's not terribly useful.
But jpegs exported by Lightroom Classic write the 'tech' tag, and
it seems nice to be able to dump its contents.
signatureType stores a single u32 which for different tags with this
type means different things.
In each case, the value is one from a short table of valid values,
suggesting this should be a per-tag enum class instead of a
per-tag DistinctFourCC, per the comment at the top of DistincFourCC.h.
On the other hand, 3 of the 4 tables have an explicit "It is possible
that the ICC will define other signature values in the future" note,
which suggests the FourCC might actually be the way to go.
For now, just punt on that and manually dump the u32 in fourcc style
in icc.cpp and don't add any to_string() methods that return a readable
string based on the contents of these tables.
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/icc.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Utilities/icc.cpp b/Userland/Utilities/icc.cpp index 3f3f67107a..e0c43c68b5 100644 --- a/Userland/Utilities/icc.cpp +++ b/Userland/Utilities/icc.cpp @@ -229,6 +229,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) i++; } outln(" ]"); + } else if (tag_data->type() == Gfx::ICC::SignatureTagData::Type) { + auto& signature = static_cast<Gfx::ICC::SignatureTagData&>(*tag_data); + + // FIXME: For colorimetricIntentImageStateTag, interpret signature according to ICC v4 Table 26 + // FIXME: For perceptualRenderingIntentGamutTag, interpret signature according to ICC v4 Table 27 + // FIXME: For saturationRenderingIntentGamutTag, interpret signature according to ICC v4 Table 28 + // FIXME: For technologyTag, interpret signature according to ICC v4 Table 29 + outln(" signature: '{:c}{:c}{:c}{:c}' / 0x{:08x}", + signature.signature() >> 24, (signature.signature() >> 16) & 0xff, (signature.signature() >> 8) & 0xff, signature.signature() & 0xff, + signature.signature()); } else if (tag_data->type() == Gfx::ICC::TextDescriptionTagData::Type) { auto& text_description = static_cast<Gfx::ICC::TextDescriptionTagData&>(*tag_data); outln(" ascii: \"{}\"", text_description.ascii_description()); |