/mediacopier

Copying and renaming media files according to their original creation date with lossless JPEG rotation on the fly

Primary LanguageC++GNU General Public License v3.0GPL-3.0

📷 mediacopier

Build Status

This is an app that searches for tagged media files in a given directory and copies or moves those files to another directory while renaming them according to the specified format. The original creation date is used to generate a folder structure and unique filenames. It supports a wide variety of image and videos formats (including raw) and features lossless on-the-fly auto-rotation of JPEG files.

The app focusses on integrating into the native KDE Plasma notification system and context menu (screenshot) but other desktop environments are supported as well.

Getting Started

🔨 Build and Install

Direct dependencies (library):

Direct dependencies (tools):

Clone this repository and create a build directory

git clone --recursive https://github.com/patrickziegler/MediaCopier.git
cd MediaCopier && mkdir build && cd build

Build and install the package

cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_QT=ON -DENABLE_KDE=ON -DCMAKE_BUILD_TYPE=release .. && make -j$(nproc) && sudo make install

Available cmake flags

Flag Description Default
ENABLE_CLI Build simple CLI tool ON
ENABLE_QT Build Qt based graphical user interface OFF
ENABLE_KDE Enable KDE integration for GUI OFF
ENABLE_SHARED_LIB Build shared instead of static lib OFF
ENABLE_TEST Enable test targets OFF
ENABLE_TEST_COVERAGE Enable test and coverage targets OFF
INSTALL_DEV_FILES Install library headers and cmake targets OFF

🏭 Containerized build environment

Build the container image as specified in the Dockerfile

docker build \
    --build-arg USER_NAME=$(id -nu) \
    --build-arg USER_UID=$(id -u) \
    --build-arg USER_GID=$(id -g) \
    -t mediacopier-build .

Start the build environment with the following command

docker run -it --rm -v ${PWD}:/usr/src/mediacopier -u $(id -nu) mediacopier-build

Alternatively, with rootless podman you don't have to specify the user

podman run -it --rm -v ${PWD}:/usr/src/mediacopier mediacopier-build

Inside the container, run the test suite with the following commands

cmake -DENABLE_TEST=ON /usr/src/mediacopier/ && make -j $(nproc) && make test

Alternatively, create a test coverage report like this (result can also be found here)

cmake -DENABLE_TEST_COVERAGE=ON /usr/src/mediacopier/ && make -j $(nproc) && make coverage

📎 Build Instructions for Windows

Prepare the vcpkg environment like described in a very helpful article by Sam Elborai

.\bootstrap-vcpkg.bat -disableMetrics
.\vcpkg.exe install spdlog exiv2 libjpeg-turbo ffmpeg range-v3 qt5 --triplet=x64-windows
.\vcpkg.exe list --triplet=x64-windows # check installed packages

Use the vcpkg toolchain file with cmake

cmake -DCMAKE_TOOLCHAIN_FILE=${VCPKG_DIR}\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -B build -S .
cmake --build build --config Release

License

This project is licensed under the GPL - see the LICENSE file for details