From 004b2fe6fe520316258acefc7b6e508698cf0056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= <1671644+arrufat@users.noreply.github.com> Date: Fri, 7 Apr 2023 21:08:27 +0900 Subject: [PATCH] Fix imglab changing the current dir too soon (#2761) --- tools/imglab/src/flip_dataset.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/imglab/src/flip_dataset.cpp b/tools/imglab/src/flip_dataset.cpp index b5ca1cdf3..943153167 100644 --- a/tools/imglab/src/flip_dataset.cpp +++ b/tools/imglab/src/flip_dataset.cpp @@ -198,15 +198,14 @@ void flip_dataset(const command_line_parser& parser) load_image_dataset_metadata(metadata,datasource); orig_metadata = metadata; + const string metadata_filename = get_parent_directory(file(datasource)).full_name() + + directory::get_separator() + "flipped_" + file(datasource).name(); + // Set the current directory to be the one that contains the // metadata file. We do this because the file might contain // file paths which are relative to this folder. set_current_dir(get_parent_directory(file(datasource))); - const string metadata_filename = get_parent_directory(file(datasource)).full_name() + - directory::get_separator() + "flipped_" + file(datasource).name(); - - array2d img, temp; for (unsigned long i = 0; i < metadata.images.size(); ++i) {