Skip to content

Zheng-Bote/qt_files_photo-gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

files_photo-gallery

QT6 CXX23 SCS to convert photos and add Metadata to Database

Report Issue Request Feature

MIT License GitHub Created At


Table of Contents


Description

QT CXX

QT6 C++23 Self Contained System (SCS) to convert photos, collect Exif/IPTC and add metadata to DB.

The purpose of this tool is to run as a microservice to prepare photos for a web-based photo-gallery.

Photos are converted into different sizes in WebP format and the metadata is written into a database.

Any existing Exif and IPTC metadata is also taken into account.

flowchart LR;
  A["`local storage
  **Photos**`"] --> B[[files to photo-db]]
  B-- Metadata ---C[(**Database**)]
  B-- "sql" ---D["`**SQL-File**
  _insert into ..._`"]
  B-- "convert & enrich" ---S[["`local storage
  **./WebP-Photos**`"]]
Loading

Features

  • Webserver (SCS) for steering and managing
  • supports PostgreSQL (insert)
  • supports SQLite3 (incl. create tables, indexes, triggers; insert)
  • supports exports to SQL-file ("native", system-independent SQL; insert)
  • supports exports to csv-file
  • Exchangeable Image File Format (Exif; read, write; sql insert)
  • IPTC-IIM (IPTC; read, write; sql insert)
  • converts images to several WebP / PNG sizes
  • (db) password encryption
  • Plugin-based System (eg. PG, SQLite3, EXIF/IPTC, WebP, PNG)
  • advanced-extra-super-ultra-special feature xyz

  • OSS and license
  • works as designed
  • no bugs

  • some more or less usefull Github Actions for GH-repo, GH-pages, GH-wiki, CI/CD-Pipelines, Release-Mgmt.
  • Package-Manager: Conan
  • Buildsystem: CMake
  • Clang-Tidy (cppcoreguidelines-*)
  • Documentation: Doxygen (modern style)
  • Installer: CMake
  • Packaging: CPack (IFW;DEB;ZIP;TBZ2;RPM)
  • graphical installer (QT6 IFW)
  • portable application / runtime binaries (see Release)
  • SBOM included (static; also Linux shell commands; GH-Action in work)
  • separation of documentation (general Readme - detailed /docs/*)
  • configuration via YAML
  • configuration via INI file

  • runs on DOS/Windows
  • runs on MacOS
  • runs on Linux
  • runs on iOS
  • runs on Android
  • runs on HarmonyOS

(back to top)

Status

Application / Tool

Status

GitHub Issues GitHub Pull Requests

Documentation

see also: Application Documentation

README

Repo - create Repo-Tree in README.md

Repo - update Readme

other Markdown files

Repo - create TOC of Markdown files

create ToC in Markdown files in folders

  • .github/actions/**
  • .github/workflows/**
  • dist/**
  • docs/**

(back to top)

Installation

bla bla ... everything easy and green with No Code/Low code and without any costs

Dependencies

All licenses are therefore GPL-compatible.

Conan

Conan, software package manager for C and C++ developers

Conan MIT License

CMake

CMake: A Powerful Software Build System

CMake BSD-3 License

Doxygen

Code Documentation. Automated.

Doxygen GPL-2 License

Doxygen Awesome

Doxygen Awesome is a custom CSS theme for Doxygen HTML documentation.

This theme is an attempt to update the visuals of Doxygen without changing its overall layout too much.

Doxygen Awesome MIT License

QT

QT6 - Community Edition

The Qt framework contains a comprehensive set of highly intuitive and modularized C++ library classes and is loaded with APIs to simplify your application development. Qt produces highly readable, easily maintainable and reusable code with high runtime performance and small footprint – and it's cross-platform.

QT LGPL see also:Obligations of the GPL and LGPL

cxxopts

a lightweight C++ option parser library, supporting the standard GNU style syntax for options.

jarro2783 MIT License

Note

managed via the package manager Conan Center

inifile-cpp

inifile-cpp is a simple and easy to use single header-only ini file en- and decoder for C++.

Fabian Meyer MIT License

Note

included in src/includes

plog

Plog - portable, simple and extensible C++ logging library

Sergey Podobry MIT License

Note

managed via the package manager Conan Center

folder structure

.
├── .github
│   ├── actions
│   │   └── doctoc
│   │       ├── README.md
│   │       ├── action.yml
│   │       └── dist
│   │           ├── index.js
│   │           ├── index.js.map
│   │           ├── licenses.txt
│   │           └── sourcemap-register.js
│   └── workflows
│       ├── ghp-create_doctoc.yml
│       ├── ghp-markdown_index.yml
│       ├── repo-actions_docu.yml
│       ├── repo-call_Readme.yml
│       ├── repo-create_doctoc.yml_
│       ├── repo-create_doctoc_md.yml
│       ├── repo-create_tree_readme.yml
│       └── repo-test_sbom.yml
├── .gitignore
├── LICENSE
├── README.md
├── dist
│   ├── README.md
│   ├── atom_usages_v0.1.5.json
│   ├── main.cpp_v0.1.4.svg
│   ├── qt_files_photo-gallery.ini
│   ├── sbom_v0.1.5.json
│   └── screenshot_graphical-installer_de.png
├── src
│   ├── CMAKEGraphVizOptions.cmake
│   ├── CMakeLists.txt
│   ├── conanfile.txt
│   ├── configure
│   │   ├── ClangTidy.cmake
│   │   ├── Doxygen.cmake
│   │   ├── extra_headers
│   │   └── rz_config.h.in
│   ├── includes
│   │   ├── httplib.h
│   │   ├── inicpp.h
│   │   ├── qaesencryption.cpp
│   │   ├── qaesencryption.h
│   │   ├── rz_aes.cpp
│   │   ├── rz_aes.h
│   │   ├── rz_datetime.cpp
│   │   ├── rz_datetime.hpp
│   │   ├── rz_do_thread.cpp
│   │   ├── rz_do_thread.hpp
│   │   ├── rz_filesystem.cpp
│   │   ├── rz_filesystem.hpp
│   │   ├── rz_inifile.cpp
│   │   ├── rz_inifile.hpp
│   │   ├── rz_options.hpp
│   │   ├── rz_output.cpp
│   │   ├── rz_output.hpp
│   │   ├── rz_pg_db.cpp
│   │   ├── rz_pg_db.hpp
│   │   ├── rz_photo-gallery_plugins.hpp
│   │   ├── rz_qt_snippets.cpp
│   │   ├── rz_qt_snippets.hpp
│   │   ├── rz_readdir.cpp
│   │   ├── rz_readdir.hpp
│   │   ├── rz_snippets.cpp
│   │   ├── rz_snippets.hpp
│   │   ├── rz_sqlite3_db.cpp
│   │   ├── rz_sqlite3_db.hpp
│   │   ├── rz_string_lib.hpp
│   │   └── rz_webserver.hpp
│   └── main.cpp
└── tree.bak

9 directories, 62 files

(back to top)

Build

QT

QT6

just load the project in QT Creator and run build or <release...>

manually

Linux, macOS

cd src

conan install . --output-folder=../build --build=missing

cd ../build

cmake -S ../src -B . -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake  -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release

# cmake --build . --parallel <number of CPU cores>
cmake --build .

Note

generate Doxygen documentation with cd build && cmake --build . --target doxygen

(back to top)

Packaging

Linux, macOS

cd build && sudo cpack -G "ZIP;DEB;RPM" -B packages
# or
cd build && sudo cmake --build . --target package
cd build && sudo cmake --build . --target  package_source

Install

Binaries

depends on your system

rpm -i files_photo-gallery-0.1.5-Linux.rpm

dpkg -i files_photo-gallery-0.1.5-Linux.deb

unzip files_photo-gallery-0.1.5-Linux.zip

....

# graphical installer (QT6 IFW)
./files_photo-gallery-0.1.5-Linux.run

manually

Linux, macOS

Installing the binary and all necessary dependency libs:

cd build && sudo cmake --install .

API Reference

Important

still under construction.

Inputs / Parameters

Note

at least 1 parameter is required

  • -a or -i <path to>/<ini file>
  • use -a for shortcut
  • use -a -e <env> for shortcut
  • use -i <path to>/<ini file>
  • use -i <path to>/<ini file> -e <env>

Important

still under construction.

Parameter Type Description
-a --auto none Optional: load Ini `//.config/.ini>``
-c --create string Optional: create Ini <path to>/<file.ini> or default: /<user home>/.config/<program>.ini>
-e --env string Optional: <dev> , <int> , <prod> or default:dev
-i --ini string Optional: <pathTo/inifile>
-l --listini string Optional: <pathTo/inifile> or default: default: //.config/.ini>`
-v --version string Optional: <program>-v<major>.<minor>.<patch>
-h --help string Optional: list help menu

Outputs

  • exit(EXIT_SUCCESS) or exit(EXIT_FAILURE)

  • PostgreSQL: inserted rows

  • SQLite3: created tables, indexes, triggers; inserted rows

  • SQL-File: created file with sql inserts

flowchart TD;
  A["`local storage
  **Photos**`"] --> P[[files to photo-db]]
  P --> E[[Exif]] & I[[IPTC]] --> M(Photos)
  M --> D[("`Database
  **Metadata**`")] & Q["`**SQL-File**
  _insert into ..._`"] & N[["`local storage
  **converted Photos**
  _./WebP/size a
  ./WebP/size b
  ./WebP/size..._`"]] --> C{OK?}
  C ---->|No| F["**EXIT_FAILURE**"]
  C ---->|Yes| O["**EXIT_SUCCESS**"]
Loading

(back to top)

Documentation

Important

documentation is still under construction.

see also folder: dist

Note

generate Doxygen documentation with cd build && cmake --build . --target doxygen

under constrcution:

GH-Page

Architecture

Github

Github Repo

block-beta
  columns 3
  Repo:3
  block:group1:1
    columns 1
    id0[".github"]
    block:group2:1
      columns 1
      id1[["workflows"]]
      id2[["actions"]]
    end
  end
  dist src
  block:group3:3
    %% columns auto (default)
    A["docs"] B["gh-pages"]
  end
Loading

Github Actions / Workflows

flowchart TD;
    A[Workflow]-. parameter .->B[[callable Workflow]]
    B-- parameter -->C[Action]
    C-->D(README)

    A[Workflow]-. parameter .->E[[callable Workflow]]
    E-- parameter -->F[Action]
    F-->J(Markdown files)

    A[Workflow]-->K[[Workflow]]
    K-->L[Action]
    L-->M("GH-Pages")
Loading

(back to top)

Application

bounded context

  • Webserver NGinx
  • Appserver (Applicationserver) Rust Rocket
  • Database PostgreSQL
  • Storage (for Webserver static content as well as for Appserver Photo-Gallery management)
architecture-beta
    group bounded_context(cloud)[Web Photo Gallery]

    service server1(server)[Webserver] in bounded_context
    service server2(server)[Appserver] in bounded_context
    service db(database)[Database] in bounded_context
    service disk1(disk)[Storage] in bounded_context
    service disk2(disk)[Storage] in bounded_context

    disk1:L -- R:server1
    server1:T -- B:server2
    disk2:L -- R:server2
    db:B -- T:server2
Loading

data import

  • collecting local files
  • read attributes (size, geometry)
  • read Exif/IPTC (if present)
  • write Metadata to DB|SQL-File
  • convert files to WebP
flowchart LR;
  A["`local storage
  **Photos**`"] --> B[[files to photo-db]]
  B-- Metadata ---C[(**Database**)]
  B-- "sql" ---D["`**SQL-File**
  _insert into ..._`"]
  B-- "convert & enrich" ---S[["`local storage
  **./WebP-Photos**`"]]
Loading

Usage/Examples/Tests

Usage

Note

at least 1 parameter is required: -a or -i <path to>/<ini file>

Tip

use -a for shortcut use -a -e <env> for shortcut use -i <path to>/<ini file> use -i <path to>/<ini file> -e <env>

(back to top)

Example Inifile

see dist/qt_files_photo-gallery.ini

Tip

call: <prog> -c : create new Inifile call: <prog> -l : list existing Inifile

(back to top)

DevOps

SHA256 Checksum

during build a SHA2-256 checksum is generated and stored

Note

see build/qt_files_photo-gallery.sha256sum

Linux

generate

sha256sum qt_files_photo-gallery > qt_files_photo-gallery.sha256sum

check

sha256sum --check qt_files_photo-gallery.sha256sum

MacOS

generate

shasum -a 256 qt_files_photo-gallery > qt_files_photo-gallery.sha256sum

check

shasum --check qt_files_photo-gallery.sha256sum

Graphviz

Tip

create a file src/CMAKEGraphVizOptions.cmake

content of CMAKEGraphVizOptions.cmake: set(GRAPHVIZ_CUSTOM_TARGETS TRUE)

cd ../build
cmake --graphviz=qt_files_photo-gallery.dot .

goto https://dreampuf.github.io/GraphvizOnline/ and fill in the content of file qt_files_photo-gallery.dot

Software Bill of Materials (SBoM)

Note

A Github Action/Workflow to produce a SPDX/CycloneDX JSON SBoM during Release, is still under construction.

nvm use --lts

atom -J-Xmx16g usages -o app.atom --slice-outfile ./dist/atom_usages_v0.1.0.json -l cpp ./src

cdxgen -o ./dist/sbom_v0.1.0.json -t cpp --usages-slices-file ./dist/atom_usages_v0.1.0.json --author "ZHENG Robert" --deep -r ./src

(back to top)

Authors and License

License

MIT License

Copyright (c) 2024 ZHENG Robert

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors

  • Zheng Robert

Code Contributors

Contributors


🖖

(back to top)

About

QT6 C++23 SCS to convert photos, collect Exif/IPTC and add metadata to DB

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •