Skip to content

Commit

Permalink
Adapt to breaking changes in Exiv2
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickziegler committed Sep 10, 2023
1 parent 487bc89 commit 4d92e6d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)

list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

project(mediacopier VERSION 2.0.5)
project(mediacopier VERSION 2.0.6)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
2 changes: 1 addition & 1 deletion mediacopier-cli/source/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Config::Config(const QApplication& app)

parser.setApplicationDescription(
app.applicationName() +
", Copyright (C) 2020-2022 Patrick Ziegler");
", Copyright (C) 2020-2023 Patrick Ziegler");

parser.addPositionalArgument(
"SRC", "Input directory", "[SRC");
Expand Down
4 changes: 4 additions & 0 deletions mediacopier-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ find_package(spdlog REQUIRED)
pkg_check_modules(AVFORMAT REQUIRED libavformat libavutil)
pkg_check_modules(LIBJPEG REQUIRED libturbojpeg)

if(exiv2_VERSION VERSION_LESS "0.28")
add_compile_definitions(EXIV2_HAS_TOLONG=1)
endif()

set(TARGET_NAME ${MEDIACOPIER_LIB_TARGET_NAME})

configure_file(
Expand Down
4 changes: 4 additions & 0 deletions mediacopier-lib/source/file_info_image_jpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ FileInfoImageJpeg::FileInfoImageJpeg(std::filesystem::path path, Exiv2::ExifData
throw FileInfoImageJpegError{"Field 'Exif.Image.Orientation' not found in metadata"};
}

#ifdef EXIV2_HAS_TOLONG
auto orientation = item->toLong();
#else
auto orientation = item->toInt64();
#endif

if (orientation < static_cast<long>(Orientation::ROT_0) || orientation > static_cast<long>(Orientation::ROT_90)) {
throw FileInfoImageJpegError{"Invalid orientation value"};
Expand Down

0 comments on commit 4d92e6d

Please sign in to comment.