From ff56d1a575ab4797530873cbfb2756f3e2d6ae24 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 3 Sep 2018 09:06:50 -0400 Subject: [PATCH] Started upgrading libexiv2 Former-commit-id: b5db5003c7fe2f266e75874ec886a403918a33df --- SuperBuild/CMakeLists.txt | 1 + modules/odm_extract_utm/CMakeLists.txt | 2 +- modules/odm_extract_utm/src/UtmExtractor.cpp | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index d559a410..dbbdefa8 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -125,6 +125,7 @@ set(custom_libs OpenGV Catkin Ecto LASzip + Exiv2 PDAL MvsTexturing ) diff --git a/modules/odm_extract_utm/CMakeLists.txt b/modules/odm_extract_utm/CMakeLists.txt index 460b83e9..069466fd 100644 --- a/modules/odm_extract_utm/CMakeLists.txt +++ b/modules/odm_extract_utm/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8) set(PROJ4_INCLUDE_DIR "/usr/include/" CACHE "PROJ4_INCLUDE_DIR" "Path to the proj4 inlcude directory") find_library(PROJ4_LIBRARY "libproj.so" PATHS "/usr/lib" "/usr/lib/x86_64-linux-gnu") -find_library(EXIV2_LIBRARY "libexiv2.so" PATHS "/usr/lib" "/usr/lib/x86_64-linux-gnu") +find_library(EXIV2_LIBRARY "libexiv2.so" PATHS "../SuperBuild/install/lib") # Add compiler options. add_definitions(-Wall -Wextra) diff --git a/modules/odm_extract_utm/src/UtmExtractor.cpp b/modules/odm_extract_utm/src/UtmExtractor.cpp index ff268784..0dc960fe 100644 --- a/modules/odm_extract_utm/src/UtmExtractor.cpp +++ b/modules/odm_extract_utm/src/UtmExtractor.cpp @@ -50,7 +50,7 @@ int UtmExtractor::run(int argc, char **argv) log_ << "For more detailed information, see log file." << "\n"; return EXIT_FAILURE; } - catch (const std::exception& e) + catch (const std::runtime_error& e) { log_.setIsPrintingInCout(true); log_ << "Error in OdmExtractUtm:\n"; @@ -175,7 +175,7 @@ void UtmExtractor::extractUtm() if (image.get() == 0) { std::string error(imageFilename); error += ": Image cannot be read"; - throw Exiv2::Error(1, error); + throw std::runtime_error(error.c_str()); } else { image->readMetadata(); @@ -184,7 +184,7 @@ void UtmExtractor::extractUtm() if (exifData.empty()) { std::string error(imageFilename); error += ": No Exif data found in the file"; - throw Exiv2::Error(1, error); + throw std::runtime_error(error.c_str()); } // Parse exif data for positional data