fix(config): correct weight->width typo in output-dimensions filter
This commit is contained in:
+6
-6
@@ -174,8 +174,8 @@ void Config::mergeConfig(Json::Value& a_config_, Json::Value& b_config_) {
|
|||||||
spdlog::error("Cannot merge config, conflicting or invalid JSON types");
|
spdlog::error("Cannot merge config, conflicting or invalid JSON types");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool isValidOutput(const Json::Value& config, const std::string& name, const std::string& identifier,
|
bool isValidOutput(const Json::Value& config, const std::string& name,
|
||||||
int32_t width, int32_t height) {
|
const std::string& identifier, int32_t width, int32_t height) {
|
||||||
const auto isOutputMatches = [&](const std::string& output) -> bool {
|
const auto isOutputMatches = [&](const std::string& output) -> bool {
|
||||||
if (output.substr(0, 1) == "$") {
|
if (output.substr(0, 1) == "$") {
|
||||||
auto* const environment_value = std::getenv(output.substr(1).c_str());
|
auto* const environment_value = std::getenv(output.substr(1).c_str());
|
||||||
@@ -235,7 +235,7 @@ bool isValidOutput(const Json::Value& config, const std::string& name, const std
|
|||||||
config_output_dimensions = jsonArray;
|
config_output_dimensions = jsonArray;
|
||||||
}
|
}
|
||||||
if (config_output_dimensions.isArray()) {
|
if (config_output_dimensions.isArray()) {
|
||||||
for (auto const &config_output_dimension : config_output_dimensions) {
|
for (auto const& config_output_dimension : config_output_dimensions) {
|
||||||
if (!config_output_dimension.isString()) {
|
if (!config_output_dimension.isString()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -250,13 +250,13 @@ bool isValidOutput(const Json::Value& config, const std::string& name, const std
|
|||||||
int comparison_value;
|
int comparison_value;
|
||||||
if (dimension == "height") {
|
if (dimension == "height") {
|
||||||
comparison_value = height;
|
comparison_value = height;
|
||||||
} else if (dimension == "weight") {
|
} else if (dimension == "width") {
|
||||||
comparison_value = weight;
|
comparison_value = width;
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((comparator == "<" && comparison_value >= value) ||
|
if ((comparator == "<" && comparison_value >= value) ||
|
||||||
(comparator == ">" && comparison_value <= value)) {
|
(comparator == ">" && comparison_value <= value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user