We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7ccafb commit d60fb27Copy full SHA for d60fb27
examples/cli/main.cpp
@@ -394,12 +394,15 @@ bool save_results(const SDCliParams& cli_params,
394
395
fs::path base_path = out_path;
396
fs::path ext = out_path.has_extension() ? out_path.extension() : fs::path{};
397
- if (!ext.empty())
398
- base_path.replace_extension();
399
400
std::string ext_lower = ext.string();
401
std::transform(ext_lower.begin(), ext_lower.end(), ext_lower.begin(), ::tolower);
402
bool is_jpg = (ext_lower == ".jpg" || ext_lower == ".jpeg" || ext_lower == ".jpe");
+ if (!ext.empty()) {
+ if (is_jpg || ext_lower == ".png") {
403
+ base_path.replace_extension();
404
+ }
405
406
407
int output_begin_idx = cli_params.output_begin_idx;
408
if (output_begin_idx < 0) {
0 commit comments