https://github.com/patrickziegler/mediacopier
Tools for copying media files and removing duplicates in your photo collections
https://github.com/patrickziegler/mediacopier
avformat avutil cmake exif exiv2 filesystem libjpeg
Last synced: 6 months ago
JSON representation
Tools for copying media files and removing duplicates in your photo collections
- Host: GitHub
- URL: https://github.com/patrickziegler/mediacopier
- Owner: patrickziegler
- License: gpl-3.0
- Created: 2019-02-03T10:49:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2026-01-11T13:17:11.000Z (6 months ago)
- Last Synced: 2026-01-11T15:55:05.560Z (6 months ago)
- Topics: avformat, avutil, cmake, exif, exiv2, filesystem, libjpeg
- Language: C++
- Homepage:
- Size: 1.28 MB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
mediacopier
[](https://github.com/patrickziegler/MediaCopier/actions/workflows/build-and-test.yml?query=branch%3Amaster)
[](https://coveralls.io/github/patrickziegler/mediacopier?branch=master)
This app 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](https://kde.org/de/) notification system and context menu ([screenshot](https://i.imgur.com/LF5Vnj9.mp4)) but other desktop environments are supported as well.
Valid format specifiers for the renaming pattern can be found [here](https://en.cppreference.com/w/cpp/chrono/system_clock/formatter.html).
## Getting Started
### :anchor: Install via Package Manager
#### openSUSE
[](https://build.opensuse.org/package/show/home:zipat:mediacopier/mediacopier)
There are packages being built with the [Open Build Service](https://openbuildservice.org/). You can add the repostory to your distribution and install `mediacopier` easily with the following commands:
```
zypper ar -f https://download.opensuse.org/repositories/home:/zipat:/mediacopier/openSUSE_Tumbleweed/ mediacopier
zypper in mediacopier-plasma
```
### :hammer: Manually Build and Install
Dependencies:
- Exiv2 (https://exiv2.org/)
- ffmpeg (https://www.ffmpeg.org/download.html)
- libjpeg-turbo (https://libjpeg-turbo.org/)
- spdlog (https://github.com/gabime/spdlog) >=[1.9.2](https://github.com/gabime/spdlog/releases/tag/v1.9.2)
- toml11 (https://github.com/ToruNiina/toml11)
- CLI11 (https://github.com/CLIUtils/CLI11)
- Qt5 or Qt6 (https://doc.qt.io/qt-6/)
- KJobWidgets (https://api.kde.org/frameworks/kjobwidgets/html/index.html)
For openSUSE, these dependencies can be installed via the following commands
```sh
zypper install spdlog-devel toml11-devel libexiv2-devel libjpeg8-devel ffmpeg-7-libavformat-devel ffmpeg-7-libavutil-devel # for the core library
zypper install cli11-devel # for the pure command line interface
zypper install qt6-core-devel qt6-widgets-devel qt6-statemachine-devel qt6-linguist-devel # for Qt based graphical user interface
zypper install kf6-ki18n-devel kf6-kjobwidgets-devel # for the KDE Plasma integration
zypper install gtest lcov clang exiftool ImageMagick # for testing
```
Clone this repository and create a build directory
```sh
git clone https://github.com/patrickziegler/MediaCopier.git
cd MediaCopier && mkdir build && cd $_
```
Build and install the package
```sh
export CC=gcc-14 CXX=g++-14 # set specific compiler (optional)
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) && sudo make install
```
Available cmake flags
| Flag | Description | Default |
|------------------------|--------------------------------------------------|---------|
| `SKIP_GUI` | Don't build graphical user interface | `OFF` |
| `SKIP_CLI` | Don't build plain command line interface | `OFF` |
| `SKIP_KDE` | Don't build KDE Plasma integration | `OFF` |
| `USE_QT5` | Build against Qt5 libraries (legacy) | `OFF` |
| `ENABLE_TEST` | Enable test targets | `OFF` |
| `ENABLE_TEST_COVERAGE` | Enable test and coverage targets | `OFF` |
| `ENABLE_CLANG_TIDY` | Enable static code analysis with `clang-tidy` | `OFF` |
### :factory: Containerized Build Environment (for development purposes)
Build und run the container image as specified in the `Dockerfile` with the following commands
```sh
docker build -t mediacopier-build .
docker run -it --rm -v ${PWD}:/run/src/mediacopier -u $(id -u):$(id -g) mediacopier-build
```
Inside the container, run the test suite or generate coverage reports with the following commands
```sh
cmake -DUSE_QT5=ON -DENABLE_TEST_COVERAGE=ON -DENABLE_CLANG_TIDY=ON /run/src/mediacopier/ && make formatcheck && make -j $(nproc) && make test && make coverage
```
### :paperclip: Build Instructions for Windows
Prepare the [vcpkg](https://github.com/microsoft/vcpkg#using-vcpkg-with-cmake) environment like described in a very helpful [article by Sam Elborai](https://sam.elborai.me/articles/vscode-cpp-dev-environment-2020/)
```sh
.\bootstrap-vcpkg.bat -disableMetrics
.\vcpkg.exe install spdlog exiv2 libjpeg-turbo ffmpeg qt5 --triplet=x64-windows
.\vcpkg.exe list --triplet=x64-windows # check installed packages
```
Use the vcpkg toolchain file with cmake
```sh
cmake -DCMAKE_TOOLCHAIN_FILE=${VCPKG_DIR}\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DSKIP_KDE=ON -B build -S .
cmake --build build --config Release
```
## License
This project is licensed under the GPL - see the [LICENSE](LICENSE) file for details