diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Utilities/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Utilities/icc.cpp | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index ee44b5ed78..52e67a629d 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -90,6 +90,7 @@ target_link_libraries(grep PRIVATE LibRegex) target_link_libraries(gunzip PRIVATE LibCompress) target_link_libraries(gzip PRIVATE LibCompress) target_link_libraries(headless-browser PRIVATE LibCrypto LibGemini LibGfx LibHTTP LibTLS LibWeb LibWebSocket LibIPC LibJS) +target_link_libraries(icc PRIVATE LibGfx) target_link_libraries(jail-attach PRIVATE LibCore LibMain) target_link_libraries(jail-create PRIVATE LibCore LibMain) target_link_libraries(js PRIVATE LibCrypto LibJS LibLine LibLocale LibTextCodec) diff --git a/Userland/Utilities/icc.cpp b/Userland/Utilities/icc.cpp new file mode 100644 index 0000000000..87239f834c --- /dev/null +++ b/Userland/Utilities/icc.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022, Nico Weber <thakis@chromium.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include <AK/StringView.h> +#include <LibCore/ArgsParser.h> +#include <LibCore/MappedFile.h> +#include <LibGfx/ICCProfile.h> + +ErrorOr<int> serenity_main(Main::Arguments arguments) +{ + Core::ArgsParser args_parser; + + static StringView icc_path; + args_parser.add_positional_argument(icc_path, "Path to ICC profile", "FILE"); + args_parser.parse(arguments); + + auto icc_file = TRY(Core::MappedFile::map(icc_path)); + auto profile = TRY(Gfx::ICC::Profile::try_load_from_externally_owned_memory(icc_file->bytes())); + + outln("version: {}", profile->version()); + outln("device class: {}", Gfx::ICC::device_class_name(profile->device_class())); + + return 0; +} |