From e42ba3f9d4042eb062e0575ac3af8b187f1e064c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 30 Aug 2020 13:35:00 +1000 Subject: [PATCH 1/4] corrected compile issues on xenial (should fix linux CI) --- app/codec/oiio/oiiodecoder.cpp | 2 +- app/common/commandlineparser.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/codec/oiio/oiiodecoder.cpp b/app/codec/oiio/oiiodecoder.cpp index 8946ad6b6..395284c44 100644 --- a/app/codec/oiio/oiiodecoder.cpp +++ b/app/codec/oiio/oiiodecoder.cpp @@ -288,7 +288,7 @@ PixelFormat::Format OIIODecoder::GetFormatFromOIIOBasetype(const OIIO::ImageSpec rational OIIODecoder::GetPixelAspectRatioFromOIIO(const OIIO::ImageSpec &spec) { - return rational::fromDouble(spec.extra_attribs.get_float("PixelAspectRatio", 1)); + return rational::fromDouble(spec.get_float_attribute("PixelAspectRatio", 1)); } bool OIIODecoder::FileTypeIsSupported(const QString& fn) diff --git a/app/common/commandlineparser.h b/app/common/commandlineparser.h index 8f35ded73..10114d86a 100644 --- a/app/common/commandlineparser.h +++ b/app/common/commandlineparser.h @@ -22,6 +22,7 @@ #define COMMANDLINEPARSER_H #include +#include #include "common/define.h" From 8d6bd5e9294a3e60ded1df01bd6dca9772450cac Mon Sep 17 00:00:00 2001 From: Thomas Wilshaw Date: Wed, 2 Sep 2020 23:26:05 +0100 Subject: [PATCH 2/4] Fix Help option in headless mode on Windows Help option failed when Olive was run in its own directory as strrchr failed. If all else fails basename is equal to argv[0] and we don't increment in the print statement. Tested on Windows 7. --- app/common/commandlineparser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/common/commandlineparser.cpp b/app/common/commandlineparser.cpp index 584f6f1f3..deaf200ea 100644 --- a/app/common/commandlineparser.cpp +++ b/app/common/commandlineparser.cpp @@ -115,17 +115,21 @@ void CommandLineParser::PrintHelp(const char* filename) } const char* basename; + bool path = true; #ifdef Q_OS_WINDOWS basename = strrchr(filename, '\\'); if (!basename) { basename = strrchr(filename, '/'); } + if (!basename) { + basename = filename; + path = false; + } #else basename = strrchr(filename, '/'); #endif - printf("Usage: %s [options] %s\n\n", basename + 1, positional_args.toUtf8().constData()); - + printf("Usage: %s [options] %s\n\n", path ? basename + 1 : basename, positional_args.toUtf8().constData()); foreach (const KnownOption& o, options_) { QString all_args; From eed41c1f126feffafe09737f15d38d4ed338e4cb Mon Sep 17 00:00:00 2001 From: Thomas Wilshaw Date: Thu, 3 Sep 2020 15:25:07 +0100 Subject: [PATCH 3/4] Comments --- app/common/commandlineparser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/common/commandlineparser.cpp b/app/common/commandlineparser.cpp index deaf200ea..3eed80942 100644 --- a/app/common/commandlineparser.cpp +++ b/app/common/commandlineparser.cpp @@ -121,6 +121,9 @@ void CommandLineParser::PrintHelp(const char* filename) if (!basename) { basename = strrchr(filename, '/'); } + // If no slashes are found we are probably running Olive from the executables own directory + // so we set basename equal to the filename (olive-editor.exe). This ensures basename is + // always valid. if (!basename) { basename = filename; path = false; From 68233b9402c1de7017e7f17010d3e99839dee860 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 5 Sep 2020 18:56:30 +1000 Subject: [PATCH 4/4] updated basename fix for multi-platform --- app/common/commandlineparser.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/common/commandlineparser.cpp b/app/common/commandlineparser.cpp index 3eed80942..9585a0c69 100644 --- a/app/common/commandlineparser.cpp +++ b/app/common/commandlineparser.cpp @@ -115,24 +115,24 @@ void CommandLineParser::PrintHelp(const char* filename) } const char* basename; - bool path = true; #ifdef Q_OS_WINDOWS basename = strrchr(filename, '\\'); if (!basename) { basename = strrchr(filename, '/'); } - // If no slashes are found we are probably running Olive from the executables own directory - // so we set basename equal to the filename (olive-editor.exe). This ensures basename is - // always valid. - if (!basename) { - basename = filename; - path = false; - } #else basename = strrchr(filename, '/'); #endif - printf("Usage: %s [options] %s\n\n", path ? basename + 1 : basename, positional_args.toUtf8().constData()); + if (basename) { + // Slash found, increment pointer to avoid showing the slash itself + basename++; + } else { + // If no slashes are found, assume string is already a basename + basename = filename; + } + + printf("Usage: %s [options] %s\n\n", basename, positional_args.toUtf8().constData()); foreach (const KnownOption& o, options_) { QString all_args;