From 9cf7ee62f58f317da3048475d4fe37c06b33d379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 27 Sep 2022 16:51:44 +0200 Subject: [PATCH] imageconverter: move colored output logic at the top. --- src/Magnum/Trade/imageconverter.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Magnum/Trade/imageconverter.cpp b/src/Magnum/Trade/imageconverter.cpp index c8be8e95f..db9d2f725 100644 --- a/src/Magnum/Trade/imageconverter.cpp +++ b/src/Magnum/Trade/imageconverter.cpp @@ -400,6 +400,15 @@ support conversion to a file, AnyImageConverter is used to save its output; if no -C / --converter is specified, AnyImageConverter is used.)") .parse(argc, argv); + /* Colored output. Enable only if a TTY. */ + Debug::Flags useColor; + if(args.value("color") == "on") + useColor = Debug::Flags{}; + else if(args.value("color") == "off") + useColor = Debug::Flag::DisableColors; + else + useColor = Debug::isTty() ? Debug::Flags{} : Debug::Flag::DisableColors; + /* Generic checks */ if(args.value("output")) { if(args.isSet("in-place")) { @@ -591,15 +600,6 @@ no -C / --converter is specified, AnyImageConverter is used.)") Containers::Array infos = Trade::Implementation::imageInfo(*importer, error, importTime); - /* Colored output. Enable only if a TTY. */ - Debug::Flags useColor; - if(args.value("color") == "on") - useColor = Debug::Flags{}; - else if(args.value("color") == "off") - useColor = Debug::Flag::DisableColors; - else - useColor = Debug::isTty() ? Debug::Flags{} : Debug::Flag::DisableColors; - Trade::Implementation::printImageInfo(useColor, infos, nullptr, nullptr, nullptr); if(args.isSet("profile")) {