Fix imglab changing the current dir too soon (#2761)

This commit is contained in:
Adrià Arrufat 2023-04-07 21:08:27 +09:00 committed by GitHub
parent 4224951c38
commit 004b2fe6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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<rgb_pixel> img, temp;
for (unsigned long i = 0; i < metadata.images.size(); ++i)
{