From fbb225ec018b63938c29e1d283a1bf1cd830d073 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 11 Mar 2021 19:41:56 +0100 Subject: [PATCH] [matching/sfm] IO: do not call "canonical" on non-existing files --- src/aliceVision/matching/io.cpp | 7 ++++++- src/aliceVision/sfm/pipeline/regionsIO.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/aliceVision/matching/io.cpp b/src/aliceVision/matching/io.cpp index c22a74d86a..ebcee0a445 100644 --- a/src/aliceVision/matching/io.cpp +++ b/src/aliceVision/matching/io.cpp @@ -235,7 +235,12 @@ bool Load(PairwiseMatches& matches, // build up a set with normalized paths to remove duplicates std::set foldersSet; for(const auto& folder : folders) - foldersSet.insert(fs::canonical(folder).string()); + { + if(fs::exists(folder)) + { + foldersSet.insert(fs::canonical(folder).string()); + } + } for(const auto& folder : foldersSet) { diff --git a/src/aliceVision/sfm/pipeline/regionsIO.cpp b/src/aliceVision/sfm/pipeline/regionsIO.cpp index e53f3b4aa8..caafaa197c 100644 --- a/src/aliceVision/sfm/pipeline/regionsIO.cpp +++ b/src/aliceVision/sfm/pipeline/regionsIO.cpp @@ -87,7 +87,12 @@ std::unique_ptr loadFeatures(const std::vector& f // build up a set with normalized paths to remove duplicates std::set foldersSet; for(const auto& folder : folders) - foldersSet.insert(fs::canonical(folder).string()); + { + if(fs::exists(folder)) + { + foldersSet.insert(fs::canonical(folder).string()); + } + } for(const auto& folder : foldersSet) {