diff options
author | Nico Weber <thakis@chromium.org> | 2023-01-22 21:49:05 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-23 10:09:01 +0000 |
commit | e7eccf4ac84c9419b0f756cbbeb3a629c728cc62 (patch) | |
tree | 27963d6812557f18b57ab677b98b16f3e9d6a815 /Userland/Utilities | |
parent | 8272cfc9f32bb50e93f1cc42d9f07b9617c9986c (diff) | |
download | serenity-e7eccf4ac84c9419b0f756cbbeb3a629c728cc62.zip |
LibGfx+icc: Add ICCProfile support for textDescriptionType and print it
This is used in v2 profiles for the required 'desc' tag. In v2
profiles, it's also used by the 'dmnd', 'dmdd', 'scrd', 'vued' tags.
In v4 profiles, these all use 'mluc' instead (except for 'scrd', which
is no longer part of the spec in v4).
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/icc.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Utilities/icc.cpp b/Userland/Utilities/icc.cpp index fddc2c1333..0f17ebaea2 100644 --- a/Userland/Utilities/icc.cpp +++ b/Userland/Utilities/icc.cpp @@ -18,7 +18,7 @@ static ErrorOr<String> hyperlink(URL const& target, T const& label) } template<class T> -static void out_optional(char const* label, Optional<T> optional) +static void out_optional(char const* label, Optional<T> const& optional) { out("{}: ", label); if (optional.has_value()) @@ -102,6 +102,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) record.iso_3166_1_country_code >> 8, record.iso_3166_1_country_code & 0xff, record.text); } + } 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()); + out_optional(" unicode", MUST(text_description.unicode_description().map([](auto description) { return String::formatted("\"{}\"", description); }))); + outln(" unicode language code: 0x{}", text_description.unicode_language_code()); + out_optional(" macintosh", MUST(text_description.macintosh_description().map([](auto description) { return String::formatted("\"{}\"", description); }))); } else if (tag_data->type() == Gfx::ICC::TextTagData::Type) { outln(" text: \"{}\"", static_cast<Gfx::ICC::TextTagData&>(*tag_data).text()); } |