Photo-Composition-Designer 1.0.2__tar.gz → 1.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/HISTORY.md +22 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/Makefile +2 -2
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/PKG-INFO +3 -2
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/pyproject.toml +3 -2
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/_version.py +3 -3
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/config/config.py +4 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/core/base.py +20 -22
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/gui/gui.py +45 -16
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/image/CalendarRenderer.py +58 -19
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/image/DescriptionRenderer.py +12 -3
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer.egg-info/PKG-INFO +3 -2
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer.egg-info/requires.txt +2 -1
- photo_composition_designer-1.0.4/src/Photo_Composition_Designer.egg-info/scm_version.json +8 -0
- photo_composition_designer-1.0.4/tests/test_CalendarRenderer.py +134 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_CompositionDesigner.py +1 -1
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/uv.lock +15 -4
- photo_composition_designer-1.0.2/src/Photo_Composition_Designer.egg-info/scm_version.json +0 -8
- photo_composition_designer-1.0.2/tests/test_CalendarRenderer.py +0 -41
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/FUNDING.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/actions/setup-environment/action.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/dependabot.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/init.sh +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/release_message.sh +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/rename_project.sh +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/update_funding.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/workflows/build-linux.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/workflows/build-macos.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/workflows/build-win.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/workflows/main.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/workflows/release.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.github/workflows/update_readme.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.gitignore +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.idea/runConfigurations/config_generate.xml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.idea/runConfigurations/module_cli.xml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.idea/runConfigurations/module_gui.xml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.idea/vcs.xml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.pre-commit-config-linux.yaml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.pre-commit-config.yaml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/.readthedocs.yaml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/AGENTS.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/LICENSE +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/README.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/anniversaries.ini +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/config.yaml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/.nav.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/_static/img/collages.png +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/_static/img/favicon.png +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/_static/img/gui_main.png +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/_static/img/gui_settings.png +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/_static/img/logo.png +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/css/custom.css +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/funding/funding.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/getting-started/install.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/getting-started/virtual-environment.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/index.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/usage/cli.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/docs/usage/config.md +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/descriptions.txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/title/This is a description for all photos of this calender collage page. It will be displayed in one line between the photos and the calendar items..txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/title/image_02.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_1/description.txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_1/image_01.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_2/image_04.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_2/image_13.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_3/This is a description for all photos of this calender collage page. It will be displayed in one line between the photos and the calendar items..txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_3/image_02.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_3/image_03.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_3/image_07.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_4/image_08.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_4/image_09.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_4/image_10.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_4/image_13.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_5/Lisbon.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_5/image_05.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_5/image_06.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_5/image_07.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_5/image_13.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_6_testimages_3/bundschatten-sheep-7039994_1920.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_6_testimages_3/falkenpost-cars-1638594_1920.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_6_testimages_3/valdemarvan2003-vietnam-8121062_1920.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_7_testimages_4/fietzfotos-london-2928889_1920.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_7_testimages_4/piper60-spanish-84795_1920.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_7_testimages_4/sippakorn-cows-4708901_1920.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_7_testimages_4/tuananhngo-street-vendor-4176310_1920.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_8_testimages_5/landscape_one_bicycle_left.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_8_testimages_5/landscape_two_persons_right.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_8_testimages_5/portrait_one_person_top.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_8_testimages_5/portrait_two_cars_bottom.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/images/week_8_testimages_5/portrait_two_persons_bottom.jpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/locations_de.ini +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/locations_en.ini +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/mkdocs.yml +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/pytest.ini +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.README.html +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.VERSION.txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.cpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.dbf +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.prj +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.shp +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.shx +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.README.html +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.VERSION.txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.cpg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.dbf +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.prj +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.shp +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.shx +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/res/yolo/yolo26n.onnx +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/scripts/generate_config_docs.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/scripts/project_structure.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/scripts/show_filelist.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/scripts/update_readme.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/setup.cfg +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/__main__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/cli/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/cli/__main__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/cli/cli.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/common/Anniversaries.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/common/Locations.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/common/MoonPhase.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/common/Photo.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/common/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/config/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/core/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/gui/GuiLogWriter.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/gui/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/gui/__main__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/image/CollageRenderer.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/image/MapRenderer.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/image/ObjectDetector.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/image/SmartCrop.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/image/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/tools/DescriptionsFileGenerator.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/tools/GeoPlotter.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/tools/Helpers.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/tools/ImageDistributor.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer/tools/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer.egg-info/SOURCES.txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer.egg-info/dependency_links.txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer.egg-info/entry_points.txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer.egg-info/scm_file_list.json +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/Photo_Composition_Designer.egg-info/top_level.txt +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/firewall_handler.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/main.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/src/path_handler.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/template.yml.url +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/TestHelper.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/__init__.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_CollageRenderer.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_DescriptionRenderer.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_DescriptionsFileGenerator.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_GeoPlotter.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_ImageDistributor.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_Locations.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_MapRenderer.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_MoonPhase.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_ObjectDetector.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_Photo.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_SmartCrop.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_anniversaries.py +0 -0
- {photo_composition_designer-1.0.2 → photo_composition_designer-1.0.4}/tests/test_cli.py +0 -0
|
@@ -4,6 +4,28 @@ Changelog
|
|
|
4
4
|
|
|
5
5
|
(unreleased)
|
|
6
6
|
------------
|
|
7
|
+
- Clear cache only optionally with explicit menu entry. [Paul Magister]
|
|
8
|
+
- Fix last used config issue: pass config into MainGui. [Paul Magister]
|
|
9
|
+
- Align title description centrally. [Paul Magister]
|
|
10
|
+
- Do not run precommit twice on make release. [Paul Magister]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
1.0.3 (2026-06-23)
|
|
14
|
+
------------------
|
|
15
|
+
- Docs: Update HISTORY.md for release 1.0.3. [Paul Magister]
|
|
16
|
+
- Fix test for github actions. [Paul Magister]
|
|
17
|
+
- Bugfix: fix essencial bug due to overwrite size.dpi setting because of
|
|
18
|
+
copy-by-reference mistake. [Paul Magister]
|
|
19
|
+
- Bugfix: fix linux locale problem with languages. [Paul Magister]
|
|
20
|
+
- Pass language to python-holidays so holiday names are localized; load
|
|
21
|
+
subdivisions per-language. [Paul Magister]
|
|
22
|
+
|
|
23
|
+
Added test to ensure German names and Saxony holidays are present (tests/test_CalendarRenderer.py)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
1.0.2 (2026-06-22)
|
|
27
|
+
------------------
|
|
28
|
+
- Docs: Update HISTORY.md for release 1.0.2. [Paul Magister]
|
|
7
29
|
- Improve layouting: distribute 2x2 images more equally. Use image
|
|
8
30
|
importance weight where useful. Consider object area when calculating
|
|
9
31
|
importance. Clear cache at session start. [Paul Magister]
|
|
@@ -23,7 +23,7 @@ install: ## Install the project in dev mode.
|
|
|
23
23
|
|
|
24
24
|
.PHONY: lock
|
|
25
25
|
lock: ## builds the uv.make lock file and syncs the packages
|
|
26
|
-
uv lock
|
|
26
|
+
uv lock --no-cacke
|
|
27
27
|
|
|
28
28
|
.PHONY: precommit
|
|
29
29
|
# install automatic pre-commit run locally:
|
|
@@ -232,7 +232,7 @@ release: ## Create a new tag for release.
|
|
|
232
232
|
# Generate changelog *before* tagging, based on existing history up to the new tag point
|
|
233
233
|
uv run gitchangelog > HISTORY.md
|
|
234
234
|
git add HISTORY.md
|
|
235
|
-
git commit -m "docs: Update HISTORY.md for release $${NEW_TAG}"
|
|
235
|
+
GIT_COMMITTER_DATE="$(date)" git commit --no-verify -m "docs: Update HISTORY.md for release $${NEW_TAG}"
|
|
236
236
|
|
|
237
237
|
echo "Creating git tag : $${NEW_TAG}"
|
|
238
238
|
git tag "$${NEW_TAG}"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Photo-Composition-Designer
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Feature-rich Python project template for Photo-Composition-Designer.
|
|
5
5
|
Author: pamagister
|
|
6
6
|
Requires-Python: <4.0,>=3.11
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Dist: astral>=3.2
|
|
10
|
-
Requires-Dist: config-cli-gui>=0.3.
|
|
10
|
+
Requires-Dist: config-cli-gui>=0.3.7
|
|
11
11
|
Requires-Dist: ttkbootstrap>=1.20.3
|
|
12
12
|
Requires-Dist: exifread>=3.5.1
|
|
13
13
|
Requires-Dist: geopandas>=1.1.1
|
|
@@ -18,6 +18,7 @@ Requires-Dist: pytz>=2025.2
|
|
|
18
18
|
Requires-Dist: shapely>=2.1.1
|
|
19
19
|
Requires-Dist: onnxruntime>=1.26.0
|
|
20
20
|
Requires-Dist: numpy>=2.4.6
|
|
21
|
+
Requires-Dist: babel>=2.18.0
|
|
21
22
|
Provides-Extra: dev
|
|
22
23
|
Requires-Dist: pytest>=8.4.0; extra == "dev"
|
|
23
24
|
Requires-Dist: pytest-mock>=3.14.1; extra == "dev"
|
|
@@ -9,7 +9,7 @@ readme = "docs/index.md"
|
|
|
9
9
|
requires-python = ">=3.11,<4.0"
|
|
10
10
|
dependencies = [
|
|
11
11
|
"astral>=3.2",
|
|
12
|
-
"config-cli-gui>=0.3.
|
|
12
|
+
"config-cli-gui>=0.3.7",
|
|
13
13
|
"ttkbootstrap>=1.20.3",
|
|
14
14
|
"exifread>=3.5.1",
|
|
15
15
|
"geopandas>=1.1.1",
|
|
@@ -19,7 +19,8 @@ dependencies = [
|
|
|
19
19
|
"pytz>=2025.2",
|
|
20
20
|
"shapely>=2.1.1",
|
|
21
21
|
"onnxruntime>=1.26.0",
|
|
22
|
-
"numpy>=2.4.6"
|
|
22
|
+
"numpy>=2.4.6",
|
|
23
|
+
"babel>=2.18.0",
|
|
23
24
|
]
|
|
24
25
|
|
|
25
26
|
# Dev dependencies as optional dependencies
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (1, 0,
|
|
21
|
+
__version__ = version = '1.0.4'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 0, 4)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gc91424c85'
|
|
@@ -291,6 +291,10 @@ class ConfigParameterManager(ConfigManager):
|
|
|
291
291
|
)
|
|
292
292
|
super().__init__(categories, config_file, **kwargs)
|
|
293
293
|
|
|
294
|
+
@staticmethod
|
|
295
|
+
def get_app_name():
|
|
296
|
+
return "photo-composition-designer"
|
|
297
|
+
|
|
294
298
|
|
|
295
299
|
def main():
|
|
296
300
|
"""Main function to generate config file and documentation."""
|
|
@@ -80,8 +80,6 @@ class CompositionDesigner:
|
|
|
80
80
|
|
|
81
81
|
# Create ObjectDetector instance once
|
|
82
82
|
self.object_detector = ObjectDetector() if self.use_object_recognition else None
|
|
83
|
-
if self.object_detector:
|
|
84
|
-
self.object_detector.clear_cache()
|
|
85
83
|
|
|
86
84
|
# Create other helpers/generators — pass config object for them to pull values from.
|
|
87
85
|
self.mapGenerator: MapRenderer = MapRenderer.from_config(self.config)
|
|
@@ -177,15 +175,15 @@ class CompositionDesigner:
|
|
|
177
175
|
|
|
178
176
|
# description area
|
|
179
177
|
if self.config.layout.usePhotoDescription.value:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
)
|
|
178
|
+
alignment = "middle" if is_title else "left"
|
|
179
|
+
description_img = self.descGenerator.generate(photo_description, alignment)
|
|
180
|
+
# Use the actual rendered image size for height (and width) instead of getattr
|
|
181
|
+
desc_w, desc_h = description_img.size
|
|
182
|
+
# Center horizontally when this is the title page; otherwise align to left margin
|
|
183
|
+
x = 0
|
|
184
|
+
# Place the description above the calendar/title area, respecting bottom margin
|
|
185
|
+
y = self.height_px - self.calendar_height_px - desc_h - self.margin_bottom_px
|
|
186
|
+
composition.paste(description_img, (x, y))
|
|
189
187
|
|
|
190
188
|
if len(photos) == 0:
|
|
191
189
|
self.logger.info("No pictures found.")
|
|
@@ -206,17 +204,17 @@ class CompositionDesigner:
|
|
|
206
204
|
self.height_px - self.mapGenerator.height - self.margin_bottom_px,
|
|
207
205
|
),
|
|
208
206
|
)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
207
|
+
if not is_title:
|
|
208
|
+
# draw the image dates in
|
|
209
|
+
date_str = get_photo_dates(photos)
|
|
210
|
+
draw = ImageDraw.Draw(composition)
|
|
211
|
+
font = self.config.style.fontAnniversaries.value.get_image_font(self.dpi)
|
|
212
|
+
|
|
213
|
+
# Anchor rd expects coordinates relative to lower-right;
|
|
214
|
+
# to put text inside margins we shift left/up
|
|
215
|
+
x = self.width_px - self.margin_sides_px
|
|
216
|
+
y = self.height_px - self.margin_bottom_px
|
|
217
|
+
draw.text((x, y), date_str, font=font, fill=text_color2, anchor="rd")
|
|
220
218
|
|
|
221
219
|
return composition
|
|
222
220
|
|
|
@@ -6,6 +6,7 @@ with settings dialog, file management, and centralized logging capabilities.
|
|
|
6
6
|
run gui: python -m Photo_Composition_Designer.gui
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
import copy
|
|
9
10
|
import logging
|
|
10
11
|
import os
|
|
11
12
|
import shutil
|
|
@@ -50,14 +51,28 @@ class MainGui:
|
|
|
50
51
|
("distribute_group_matching_dates", "Distribute photos by date"),
|
|
51
52
|
]
|
|
52
53
|
|
|
53
|
-
def __init__(self, root):
|
|
54
|
+
def __init__(self, root, config=None):
|
|
54
55
|
self.root = root
|
|
55
56
|
self.root.title("Photo-Composition-Designer")
|
|
56
57
|
self.root.geometry("1200x800") # Increased width for new layout
|
|
57
58
|
self.root.update_idletasks()
|
|
58
59
|
|
|
59
60
|
# Initialize configuration
|
|
60
|
-
|
|
61
|
+
# Prefer the user's last used configuration if present; otherwise
|
|
62
|
+
# load a local default config.yaml without marking it as "last used"
|
|
63
|
+
# (so we don't overwrite the user's actual last-used file).
|
|
64
|
+
try:
|
|
65
|
+
last = read_last_used_config(ConfigParameterManager.get_app_name())
|
|
66
|
+
except Exception:
|
|
67
|
+
last = None
|
|
68
|
+
|
|
69
|
+
if last and Path(last).exists():
|
|
70
|
+
self._config = ConfigParameterManager(last)
|
|
71
|
+
elif Path("config.yaml").exists():
|
|
72
|
+
# Load default config but do not persist it as the "last used"
|
|
73
|
+
self._config = ConfigParameterManager("config.yaml", persist_last_used=False)
|
|
74
|
+
else:
|
|
75
|
+
self._config = ConfigParameterManager()
|
|
61
76
|
|
|
62
77
|
# Initialize logging system using individual AppConfig values
|
|
63
78
|
self.logger_manager = initialize_logging(
|
|
@@ -67,16 +82,8 @@ class MainGui:
|
|
|
67
82
|
enable_console_logging=self._config.app.enable_console_logging.value,
|
|
68
83
|
)
|
|
69
84
|
self.logger: logging.Logger = get_logger("gui.main")
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
last_cfg = self._config.get_last_used_config()
|
|
73
|
-
if last_cfg:
|
|
74
|
-
self.logger.info(f"Configuration loaded: {last_cfg}")
|
|
75
|
-
else:
|
|
76
|
-
self.logger.info("No configuration file loaded (using defaults)")
|
|
77
|
-
except Exception:
|
|
78
|
-
# Do not fail GUI startup if logging or config introspection fails
|
|
79
|
-
self.logger.debug("Could not determine last used configuration file")
|
|
85
|
+
self.logger.info(f"Anniversaries used: {self._config.general.anniversariesConfig.value}")
|
|
86
|
+
self.logger.info(f"Locations used: {self._config.general.locationsConfig.value}")
|
|
80
87
|
|
|
81
88
|
self._build_widgets()
|
|
82
89
|
self._create_menu()
|
|
@@ -260,7 +267,7 @@ class MainGui:
|
|
|
260
267
|
# File menu
|
|
261
268
|
file_menu = tk.Menu(menubar, tearoff=0)
|
|
262
269
|
menubar.add_cascade(label="File", menu=file_menu)
|
|
263
|
-
file_menu.add_command(label="
|
|
270
|
+
file_menu.add_command(label="Select config file", command=self._select_config)
|
|
264
271
|
file_menu.add_separator()
|
|
265
272
|
|
|
266
273
|
# Create Run menu options dynamically
|
|
@@ -277,6 +284,10 @@ class MainGui:
|
|
|
277
284
|
options_menu = tk.Menu(menubar, tearoff=0)
|
|
278
285
|
menubar.add_cascade(label="Options", menu=options_menu)
|
|
279
286
|
options_menu.add_command(label="Settings", command=self._open_settings)
|
|
287
|
+
options_menu.add_command(
|
|
288
|
+
label="Clear object detector cache",
|
|
289
|
+
command=self._clear_object_detector_cache,
|
|
290
|
+
)
|
|
280
291
|
|
|
281
292
|
# Help menu
|
|
282
293
|
help_menu = tk.Menu(menubar, tearoff=0)
|
|
@@ -318,12 +329,13 @@ class MainGui:
|
|
|
318
329
|
0.1, min(target_width / full_width_px, target_height / full_height_px)
|
|
319
330
|
)
|
|
320
331
|
|
|
321
|
-
|
|
332
|
+
# Use a deep copy for preview config to avoid modifying the main config
|
|
333
|
+
self._config_preview = copy.deepcopy(self._config)
|
|
322
334
|
self._config_preview.size.dpi.value = self._config.size.dpi.value * preview_scale_factor
|
|
323
335
|
|
|
324
336
|
# Create a new CompositionDesigner instance with the calculated scale factor
|
|
325
337
|
preview_designer = CompositionDesigner(
|
|
326
|
-
self.
|
|
338
|
+
self._config_preview,
|
|
327
339
|
self.logger,
|
|
328
340
|
)
|
|
329
341
|
|
|
@@ -568,6 +580,23 @@ class MainGui:
|
|
|
568
580
|
self.log_level_var.set(self._config.app.log_level.value)
|
|
569
581
|
self._reload_config()
|
|
570
582
|
|
|
583
|
+
def _clear_object_detector_cache(self):
|
|
584
|
+
"""Clear the object detector cache if object recognition is enabled."""
|
|
585
|
+
try:
|
|
586
|
+
od = getattr(self.composition_designer, "object_detector", None)
|
|
587
|
+
if od:
|
|
588
|
+
od.clear_cache()
|
|
589
|
+
messagebox.showinfo("Cache cleared", "Object detector cache cleared.")
|
|
590
|
+
self.logger.info("Object detector cache cleared via GUI")
|
|
591
|
+
else:
|
|
592
|
+
messagebox.showinfo(
|
|
593
|
+
"Not available",
|
|
594
|
+
"Object detector is not enabled in configuration.",
|
|
595
|
+
)
|
|
596
|
+
except Exception as e:
|
|
597
|
+
self.logger.error(f"Failed to clear object detector cache: {e}", exc_info=True)
|
|
598
|
+
messagebox.showerror("Error", f"Failed to clear cache: {e}")
|
|
599
|
+
|
|
571
600
|
def _open_help(self):
|
|
572
601
|
"""Open help documentation in browser."""
|
|
573
602
|
self.logger.debug("Opening help documentation")
|
|
@@ -647,7 +676,7 @@ def main():
|
|
|
647
676
|
|
|
648
677
|
# Try to restore the last used configuration file so the GUI can start
|
|
649
678
|
# with the user's preferred theme and settings.
|
|
650
|
-
last = read_last_used_config(
|
|
679
|
+
last = read_last_used_config(ConfigParameterManager.get_app_name())
|
|
651
680
|
if last and Path(last).exists():
|
|
652
681
|
_config = ConfigParameterManager(last)
|
|
653
682
|
else:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import calendar
|
|
4
|
-
import locale
|
|
5
4
|
import logging
|
|
6
5
|
from datetime import datetime, timedelta
|
|
7
6
|
from pathlib import Path
|
|
@@ -10,6 +9,7 @@ import holidays
|
|
|
10
9
|
import pytz
|
|
11
10
|
from astral import LocationInfo
|
|
12
11
|
from astral.sun import sun
|
|
12
|
+
from babel.dates import get_day_names, get_month_names
|
|
13
13
|
from config_cli_gui.configtypes.font import Font
|
|
14
14
|
from PIL import Image, ImageDraw
|
|
15
15
|
|
|
@@ -61,6 +61,7 @@ class CalendarRenderer:
|
|
|
61
61
|
startDate.year,
|
|
62
62
|
country_code,
|
|
63
63
|
holidayCountries,
|
|
64
|
+
language=self.language,
|
|
64
65
|
)
|
|
65
66
|
|
|
66
67
|
@classmethod
|
|
@@ -68,6 +69,14 @@ class CalendarRenderer:
|
|
|
68
69
|
"""Factory function to create CalendarGenerator using the config manager."""
|
|
69
70
|
margin_sides_px = mm_to_px(config.layout.marginSides.value, config.size.dpi.value)
|
|
70
71
|
|
|
72
|
+
# Resolve anniversaries config:
|
|
73
|
+
# if a file path (or string) is provided, load it via Anniversaries
|
|
74
|
+
anniv_cfg = config.general.anniversariesConfig.value
|
|
75
|
+
if isinstance(anniv_cfg, (str, Path)):
|
|
76
|
+
anniversaries_obj = Anniversaries(anniv_cfg)
|
|
77
|
+
else:
|
|
78
|
+
anniversaries_obj = anniv_cfg
|
|
79
|
+
|
|
71
80
|
return cls(
|
|
72
81
|
backgroundColor=config.style.backgroundColor.value.to_pil(),
|
|
73
82
|
fontLarge=config.style.fontLarge.value,
|
|
@@ -79,7 +88,7 @@ class CalendarRenderer:
|
|
|
79
88
|
useShortDayNames=config.layout.useShortDayNames.value,
|
|
80
89
|
useShortMonthNames=config.layout.useShortMonthNames.value,
|
|
81
90
|
marginSides=margin_sides_px,
|
|
82
|
-
anniversaries=
|
|
91
|
+
anniversaries=anniversaries_obj, # resolved object or None
|
|
83
92
|
dpi=config.size.dpi.value,
|
|
84
93
|
)
|
|
85
94
|
|
|
@@ -228,33 +237,63 @@ class CalendarRenderer:
|
|
|
228
237
|
@staticmethod
|
|
229
238
|
def get_month_name(month: int, locale_name: str, abbreviation: bool = False) -> str:
|
|
230
239
|
try:
|
|
231
|
-
|
|
240
|
+
width = "abbreviated" if abbreviation else "wide"
|
|
241
|
+
months = get_month_names(width=width, locale=locale_name)
|
|
242
|
+
return months[month].rstrip(".")
|
|
243
|
+
except Exception:
|
|
244
|
+
# Fallback auf englische Namen wie bisher
|
|
232
245
|
return calendar.month_abbr[month] if abbreviation else calendar.month_name[month]
|
|
233
|
-
except locale.Error:
|
|
234
|
-
return calendar.month_abbr[month] if abbreviation else calendar.month_name[month]
|
|
235
|
-
finally:
|
|
236
|
-
locale.setlocale(locale.LC_TIME, "")
|
|
237
246
|
|
|
238
247
|
@staticmethod
|
|
239
248
|
def get_day_name(day: int, locale_name: str) -> str:
|
|
240
249
|
try:
|
|
241
|
-
|
|
242
|
-
return
|
|
243
|
-
except
|
|
250
|
+
days = get_day_names(width="wide", locale=locale_name)
|
|
251
|
+
return days[day]
|
|
252
|
+
except Exception:
|
|
253
|
+
# Fallback auf englische Namen wie bisher
|
|
244
254
|
return calendar.day_name[day]
|
|
245
|
-
finally:
|
|
246
|
-
locale.setlocale(locale.LC_TIME, "")
|
|
247
255
|
|
|
248
256
|
@staticmethod
|
|
249
|
-
def get_combined_holidays(
|
|
257
|
+
def get_combined_holidays(
|
|
258
|
+
year: int, country: str, subdivs: list[str], language: str | None = None
|
|
259
|
+
) -> holidays.HolidayBase:
|
|
260
|
+
"""Return combined country + subdivision holidays for year and optionally localised names.
|
|
261
|
+
|
|
262
|
+
language: Optional locale string like 'de_DE' or 'en_US'. The function will extract
|
|
263
|
+
the language code (e.g. 'de') and pass it to python-holidays so names are returned
|
|
264
|
+
in the requested language when supported.
|
|
265
|
+
"""
|
|
250
266
|
years = (year, year + 1)
|
|
251
267
|
combined = holidays.HolidayBase()
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
268
|
+
|
|
269
|
+
# Determine language code for python-holidays (e.g., 'de' from 'de_DE')
|
|
270
|
+
lang_code = None
|
|
271
|
+
if language:
|
|
272
|
+
try:
|
|
273
|
+
lang_code = language.split("_")[0]
|
|
274
|
+
except Exception:
|
|
275
|
+
lang_code = language
|
|
276
|
+
|
|
277
|
+
# Load base country holidays with language if provided
|
|
278
|
+
if lang_code:
|
|
279
|
+
combined.update(holidays.country_holidays(country, years=years, language=lang_code))
|
|
280
|
+
else:
|
|
281
|
+
combined.update(holidays.country_holidays(country, years=years))
|
|
282
|
+
|
|
283
|
+
# Load subdivisions (if any).
|
|
284
|
+
# Handle errors per subdivision so one bad subdiv won't break all.
|
|
285
|
+
for sub in subdivs or []:
|
|
286
|
+
try:
|
|
287
|
+
if lang_code:
|
|
288
|
+
combined.update(
|
|
289
|
+
holidays.country_holidays(
|
|
290
|
+
country, years=years, subdiv=sub, language=lang_code
|
|
291
|
+
)
|
|
292
|
+
)
|
|
293
|
+
else:
|
|
294
|
+
combined.update(holidays.country_holidays(country, years=years, subdiv=sub))
|
|
295
|
+
except Exception as e:
|
|
296
|
+
logging.warning(f"Unable to load holiday subdivision {sub}: {e}")
|
|
258
297
|
|
|
259
298
|
return combined
|
|
260
299
|
|
|
@@ -45,7 +45,7 @@ class DescriptionRenderer:
|
|
|
45
45
|
dpi=config.size.dpi.value,
|
|
46
46
|
)
|
|
47
47
|
|
|
48
|
-
def generate(self, description: str) -> Image.Image:
|
|
48
|
+
def generate(self, description: str, alignment="middle") -> Image.Image:
|
|
49
49
|
"""Generates an image with the given description text."""
|
|
50
50
|
img = Image.new("RGB", (self.width_px, self.height_px), self.background_color)
|
|
51
51
|
draw = ImageDraw.Draw(img)
|
|
@@ -53,7 +53,16 @@ class DescriptionRenderer:
|
|
|
53
53
|
# Use the font object to get the PIL font with the correct DPI
|
|
54
54
|
pil_font = self.font.get_image_font(self.dpi)
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
if alignment == "left":
|
|
57
|
+
text_x = self.margin_side_px
|
|
58
|
+
anchor = "lb"
|
|
59
|
+
elif alignment == "middle":
|
|
60
|
+
text_x = self.width_px / 2
|
|
61
|
+
anchor = "mb"
|
|
62
|
+
else: # right
|
|
63
|
+
text_x = self.width_px
|
|
64
|
+
anchor = "rb"
|
|
65
|
+
|
|
57
66
|
text_y = self.height_px
|
|
58
67
|
|
|
59
68
|
draw.text(
|
|
@@ -61,6 +70,6 @@ class DescriptionRenderer:
|
|
|
61
70
|
description,
|
|
62
71
|
font=pil_font,
|
|
63
72
|
fill=self.font.color.to_pil(),
|
|
64
|
-
anchor=
|
|
73
|
+
anchor=anchor,
|
|
65
74
|
)
|
|
66
75
|
return img
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Photo-Composition-Designer
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Feature-rich Python project template for Photo-Composition-Designer.
|
|
5
5
|
Author: pamagister
|
|
6
6
|
Requires-Python: <4.0,>=3.11
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Dist: astral>=3.2
|
|
10
|
-
Requires-Dist: config-cli-gui>=0.3.
|
|
10
|
+
Requires-Dist: config-cli-gui>=0.3.7
|
|
11
11
|
Requires-Dist: ttkbootstrap>=1.20.3
|
|
12
12
|
Requires-Dist: exifread>=3.5.1
|
|
13
13
|
Requires-Dist: geopandas>=1.1.1
|
|
@@ -18,6 +18,7 @@ Requires-Dist: pytz>=2025.2
|
|
|
18
18
|
Requires-Dist: shapely>=2.1.1
|
|
19
19
|
Requires-Dist: onnxruntime>=1.26.0
|
|
20
20
|
Requires-Dist: numpy>=2.4.6
|
|
21
|
+
Requires-Dist: babel>=2.18.0
|
|
21
22
|
Provides-Extra: dev
|
|
22
23
|
Requires-Dist: pytest>=8.4.0; extra == "dev"
|
|
23
24
|
Requires-Dist: pytest-mock>=3.14.1; extra == "dev"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
astral>=3.2
|
|
2
|
-
config-cli-gui>=0.3.
|
|
2
|
+
config-cli-gui>=0.3.7
|
|
3
3
|
ttkbootstrap>=1.20.3
|
|
4
4
|
exifread>=3.5.1
|
|
5
5
|
geopandas>=1.1.1
|
|
@@ -10,6 +10,7 @@ pytz>=2025.2
|
|
|
10
10
|
shapely>=2.1.1
|
|
11
11
|
onnxruntime>=1.26.0
|
|
12
12
|
numpy>=2.4.6
|
|
13
|
+
babel>=2.18.0
|
|
13
14
|
|
|
14
15
|
[dev]
|
|
15
16
|
pytest>=8.4.0
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import holidays
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
from Photo_Composition_Designer.config.config import ConfigParameterManager
|
|
5
|
+
from Photo_Composition_Designer.image.CalendarRenderer import CalendarRenderer
|
|
6
|
+
|
|
7
|
+
from .TestHelper import temp_dir
|
|
8
|
+
|
|
9
|
+
print(f"Use temp dir: {temp_dir}")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_CalendarGenerator_proper_name(temp_dir):
|
|
13
|
+
# Load default config
|
|
14
|
+
config = ConfigParameterManager(persist_last_used=False)
|
|
15
|
+
|
|
16
|
+
# Build generator from config
|
|
17
|
+
cg = CalendarRenderer.from_config(config)
|
|
18
|
+
|
|
19
|
+
# Generate one title + one week
|
|
20
|
+
title_img = cg.generateTitle(
|
|
21
|
+
"Test Title",
|
|
22
|
+
width=config.size.width.value * config.size.dpi.value / 25.4,
|
|
23
|
+
height=config.size.calendarHeight.value * config.size.dpi.value / 25.4,
|
|
24
|
+
)
|
|
25
|
+
title_path = temp_dir / "title_test.jpg"
|
|
26
|
+
title_img.save(title_path)
|
|
27
|
+
|
|
28
|
+
assert title_path.exists()
|
|
29
|
+
assert title_path.stat().st_size > 0
|
|
30
|
+
|
|
31
|
+
# Weekly calendar
|
|
32
|
+
dt = config.calendar.startDate.value
|
|
33
|
+
cal_img = cg.generate(
|
|
34
|
+
dt,
|
|
35
|
+
width=config.size.width.value * config.size.dpi.value / 25.4,
|
|
36
|
+
height=config.size.calendarHeight.value * config.size.dpi.value / 25.4,
|
|
37
|
+
)
|
|
38
|
+
cal_path = temp_dir / "week_test.jpg"
|
|
39
|
+
cal_img.save(cal_path)
|
|
40
|
+
|
|
41
|
+
assert cal_path.exists()
|
|
42
|
+
assert cal_path.stat().st_size > 0
|
|
43
|
+
|
|
44
|
+
print("Generated files:", title_path, cal_path)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_holidays_localization_and_subdivision():
|
|
48
|
+
"""Ensure german holiday names are returned and Saxony-specific holidays are present."""
|
|
49
|
+
from datetime import date
|
|
50
|
+
|
|
51
|
+
# Request German localization and Saxony subdivision
|
|
52
|
+
combined = CalendarRenderer.get_combined_holidays(2025, "DE", ["SN"], language="de_DE")
|
|
53
|
+
|
|
54
|
+
# New Year's Day should be present and in German
|
|
55
|
+
new_year = date(2025, 1, 1)
|
|
56
|
+
name_ny = combined.get(new_year)
|
|
57
|
+
assert name_ny is not None
|
|
58
|
+
assert "Neujahr" in name_ny
|
|
59
|
+
|
|
60
|
+
# Reformationstag (31 Oct) should be a holiday and named in German
|
|
61
|
+
reformation = date(2025, 10, 31)
|
|
62
|
+
assert reformation in combined
|
|
63
|
+
name_ref = combined.get(reformation)
|
|
64
|
+
assert name_ref is not None
|
|
65
|
+
assert "Reformationstag" in name_ref or "Reformation" in name_ref
|
|
66
|
+
|
|
67
|
+
# Buß- und Bettag (Saxony special) - 2025-11-19 is expected
|
|
68
|
+
buss_bettag = date(2025, 11, 19)
|
|
69
|
+
assert buss_bettag in combined
|
|
70
|
+
name_buss = combined.get(buss_bettag)
|
|
71
|
+
assert name_buss is not None
|
|
72
|
+
# name may contain 'Buß' (with ß) or similar; check substring
|
|
73
|
+
assert "Buß" in name_buss or "Buss" in name_buss or "Bettag" in name_buss
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def test_get_month_name():
|
|
77
|
+
"""Verify month names (full and abbreviated) for English and German locales.
|
|
78
|
+
|
|
79
|
+
The test obtains expected strings by temporarily setting the system locale so
|
|
80
|
+
it won't hardcode locale-specific punctuation or abbreviations.
|
|
81
|
+
"""
|
|
82
|
+
# English expectations
|
|
83
|
+
assert CalendarRenderer.get_month_name(1, "en_US", abbreviation=False) == "January"
|
|
84
|
+
assert CalendarRenderer.get_month_name(1, "en_US", abbreviation=True) == "Jan"
|
|
85
|
+
|
|
86
|
+
# German expectations
|
|
87
|
+
|
|
88
|
+
assert CalendarRenderer.get_month_name(2, "de_DE", abbreviation=False) == "Februar"
|
|
89
|
+
assert CalendarRenderer.get_month_name(2, "de_DE", abbreviation=True) == "Feb"
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def test_get_day_name():
|
|
93
|
+
"""Verify weekday names for English and German locales for multiple weekdays."""
|
|
94
|
+
# Monday (0)
|
|
95
|
+
assert CalendarRenderer.get_day_name(0, "en_US") == "Monday"
|
|
96
|
+
assert CalendarRenderer.get_day_name(0, "de_DE") == "Montag"
|
|
97
|
+
assert CalendarRenderer.get_day_name(6, "de_DE") == "Sonntag"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def test_get_combined_holidays_includes_subdivision_holidays():
|
|
101
|
+
year = 2026
|
|
102
|
+
country = "DE"
|
|
103
|
+
subdiv = "SN" # Sachsen
|
|
104
|
+
|
|
105
|
+
# Load raw holiday sets to determine a subdivision-only date (if present).
|
|
106
|
+
years = (year, year + 1)
|
|
107
|
+
base = holidays.country_holidays(country, years=years)
|
|
108
|
+
sn = holidays.country_holidays(
|
|
109
|
+
country,
|
|
110
|
+
years=years,
|
|
111
|
+
subdiv=subdiv,
|
|
112
|
+
language="de",
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# Build combined using the function under test (request German localization if possible)
|
|
116
|
+
combined = CalendarRenderer.get_combined_holidays(year, country, [subdiv], language="de_DE")
|
|
117
|
+
|
|
118
|
+
assert isinstance(combined, holidays.HolidayBase)
|
|
119
|
+
|
|
120
|
+
# The combined set must contain all base country holidays
|
|
121
|
+
for d in base:
|
|
122
|
+
assert d in combined
|
|
123
|
+
|
|
124
|
+
# Find a date that exists only in the subdivision (if any) and assert it's present
|
|
125
|
+
subdiv_only = set(sn.keys()) - set(base.keys())
|
|
126
|
+
if not subdiv_only:
|
|
127
|
+
pytest.skip(
|
|
128
|
+
"No subdivision-only holidays found for DE/SN in this year; skipping specific check."
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
# Pick one subdivision-only date and verify it's included and that the name matches
|
|
132
|
+
sample_date = next(iter(subdiv_only))
|
|
133
|
+
assert sample_date in combined
|
|
134
|
+
assert combined.get(sample_date) == sn.get(sample_date)
|
|
@@ -15,7 +15,7 @@ class TestCompositionDesigner:
|
|
|
15
15
|
# -----------------------------
|
|
16
16
|
# Create light-weight config
|
|
17
17
|
# -----------------------------
|
|
18
|
-
config = ConfigParameterManager()
|
|
18
|
+
config = ConfigParameterManager(persist_last_used=False)
|
|
19
19
|
|
|
20
20
|
# Override required values
|
|
21
21
|
config.size.dpi.value = 30
|