1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:07:36 +00:00

LibGfx+icc: Print if profile id is valid

This commit is contained in:
Nico Weber 2023-01-04 15:34:25 -05:00 committed by Andreas Kling
parent fafacbb87b
commit 68f678f566
3 changed files with 34 additions and 3 deletions

View file

@ -40,9 +40,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
outln("pcs illuminant: {}", profile->pcs_illuminant());
out("id: ");
if (auto id = profile->id(); id.has_value())
outln("{}", *id);
else
if (auto id = profile->id(); id.has_value()) {
out("{}", *id);
auto computed = Gfx::ICC::Profile::compute_id(icc_file->bytes());
if (*id == computed)
outln(" (valid)");
else
outln(" (invalid! valid would be {})", computed);
} else
outln("(not set)");
return 0;