Photo-Composition-Designer 1.0.4__tar.gz → 1.0.5__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.4 → photo_composition_designer-1.0.5}/HISTORY.md +13 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/PKG-INFO +1 -1
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/_version.py +3 -3
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/core/base.py +10 -3
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/gui/gui.py +311 -33
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/image/CollageRenderer.py +28 -51
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer.egg-info/PKG-INFO +1 -1
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer.egg-info/scm_version.json +2 -2
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_CollageRenderer.py +10 -6
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/FUNDING.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/actions/setup-environment/action.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/dependabot.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/init.sh +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/release_message.sh +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/rename_project.sh +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/update_funding.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/workflows/build-linux.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/workflows/build-macos.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/workflows/build-win.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/workflows/main.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/workflows/release.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.github/workflows/update_readme.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.gitignore +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.idea/runConfigurations/config_generate.xml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.idea/runConfigurations/module_cli.xml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.idea/runConfigurations/module_gui.xml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.idea/vcs.xml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.pre-commit-config-linux.yaml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.pre-commit-config.yaml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/.readthedocs.yaml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/AGENTS.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/LICENSE +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/Makefile +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/README.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/anniversaries.ini +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/config.yaml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/.nav.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/_static/img/collages.png +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/_static/img/favicon.png +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/_static/img/gui_main.png +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/_static/img/gui_settings.png +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/_static/img/logo.png +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/css/custom.css +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/funding/funding.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/getting-started/install.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/getting-started/virtual-environment.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/index.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/usage/cli.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/docs/usage/config.md +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/descriptions.txt +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/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.4 → photo_composition_designer-1.0.5}/images/title/image_02.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_1/description.txt +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_1/image_01.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_2/image_04.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_2/image_13.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/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.4 → photo_composition_designer-1.0.5}/images/week_3/image_02.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_3/image_03.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_3/image_07.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_4/image_08.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_4/image_09.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_4/image_10.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_4/image_13.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_5/Lisbon.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_5/image_05.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_5/image_06.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_5/image_07.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_5/image_13.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_6_testimages_3/bundschatten-sheep-7039994_1920.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_6_testimages_3/falkenpost-cars-1638594_1920.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_6_testimages_3/valdemarvan2003-vietnam-8121062_1920.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_7_testimages_4/fietzfotos-london-2928889_1920.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_7_testimages_4/piper60-spanish-84795_1920.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_7_testimages_4/sippakorn-cows-4708901_1920.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_7_testimages_4/tuananhngo-street-vendor-4176310_1920.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_8_testimages_5/landscape_one_bicycle_left.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_8_testimages_5/landscape_two_persons_right.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_8_testimages_5/portrait_one_person_top.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_8_testimages_5/portrait_two_cars_bottom.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/images/week_8_testimages_5/portrait_two_persons_bottom.jpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/locations_de.ini +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/locations_en.ini +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/mkdocs.yml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/pyproject.toml +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/pytest.ini +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.README.html +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.VERSION.txt +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.cpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.dbf +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.prj +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.shp +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_admin_0_countries/ne_50m_admin_0_countries.shx +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/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.4 → photo_composition_designer-1.0.5}/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.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.cpg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.dbf +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.prj +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.shp +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/maps/ne_50m_rivers_lake_centerlines_scale_rank/ne_50m_rivers_lake_centerlines_scale_rank.shx +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/res/yolo/yolo26n.onnx +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/scripts/generate_config_docs.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/scripts/project_structure.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/scripts/show_filelist.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/scripts/update_readme.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/setup.cfg +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/__main__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/cli/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/cli/__main__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/cli/cli.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/common/Anniversaries.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/common/Locations.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/common/MoonPhase.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/common/Photo.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/common/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/config/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/config/config.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/core/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/gui/GuiLogWriter.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/gui/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/gui/__main__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/image/CalendarRenderer.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/image/DescriptionRenderer.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/image/MapRenderer.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/image/ObjectDetector.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/image/SmartCrop.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/image/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/tools/DescriptionsFileGenerator.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/tools/GeoPlotter.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/tools/Helpers.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/tools/ImageDistributor.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer/tools/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer.egg-info/SOURCES.txt +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer.egg-info/dependency_links.txt +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer.egg-info/entry_points.txt +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer.egg-info/requires.txt +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer.egg-info/scm_file_list.json +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/Photo_Composition_Designer.egg-info/top_level.txt +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/firewall_handler.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/main.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/src/path_handler.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/template.yml.url +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/TestHelper.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/__init__.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_CalendarRenderer.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_CompositionDesigner.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_DescriptionRenderer.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_DescriptionsFileGenerator.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_GeoPlotter.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_ImageDistributor.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_Locations.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_MapRenderer.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_MoonPhase.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_ObjectDetector.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_Photo.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_SmartCrop.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_anniversaries.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/tests/test_cli.py +0 -0
- {photo_composition_designer-1.0.4 → photo_composition_designer-1.0.5}/uv.lock +0 -0
|
@@ -4,6 +4,19 @@ Changelog
|
|
|
4
4
|
|
|
5
5
|
(unreleased)
|
|
6
6
|
------------
|
|
7
|
+
- Collages in Portrait mode: improve layouting for portrait collages.
|
|
8
|
+
[Paul Magister]
|
|
9
|
+
- Collages in Portrait mode: improve layouting for portrait collages.
|
|
10
|
+
[Paul Magister]
|
|
11
|
+
- Use side margins also for collage to avoid images to be cropped in
|
|
12
|
+
print shop. [Paul Magister]
|
|
13
|
+
- More intuitive workflow concept: New button structure and alignment.
|
|
14
|
+
[Paul Magister]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
1.0.4 (2026-06-24)
|
|
18
|
+
------------------
|
|
19
|
+
- Docs: Update HISTORY.md for release 1.0.4. [Paul Magister]
|
|
7
20
|
- Clear cache only optionally with explicit menu entry. [Paul Magister]
|
|
8
21
|
- Fix last used config issue: pass config into MainGui. [Paul Magister]
|
|
9
22
|
- Align title description centrally. [Paul Magister]
|
|
@@ -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.5'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 0, 5)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g09d308c72'
|
|
@@ -89,8 +89,9 @@ class CompositionDesigner:
|
|
|
89
89
|
|
|
90
90
|
# Photo layout manager expects pixel dims: width, collage_height, spacing, backgroundColor
|
|
91
91
|
collage_height_px = self.get_available_collage_height_px()
|
|
92
|
+
collage_width_py = self.get_available_collage_width_px()
|
|
92
93
|
self.layoutManager: CollageRenderer = CollageRenderer(
|
|
93
|
-
|
|
94
|
+
collage_width_py,
|
|
94
95
|
collage_height_px,
|
|
95
96
|
self.spacing_px,
|
|
96
97
|
background_color,
|
|
@@ -108,6 +109,12 @@ class CompositionDesigner:
|
|
|
108
109
|
# ---------------------------------------------------------------------
|
|
109
110
|
# Helpers: unit conversions & derived sizes
|
|
110
111
|
# ---------------------------------------------------------------------
|
|
112
|
+
def get_available_collage_width_px(self) -> int:
|
|
113
|
+
available_width = self.width_px
|
|
114
|
+
# side margins reduce space
|
|
115
|
+
available_width -= 2 * self.margin_sides_px
|
|
116
|
+
return int(available_width)
|
|
117
|
+
|
|
111
118
|
def get_available_collage_height_px(self) -> int:
|
|
112
119
|
"""
|
|
113
120
|
Compute available vertical space for the collage area in pixels.
|
|
@@ -191,7 +198,7 @@ class CompositionDesigner:
|
|
|
191
198
|
|
|
192
199
|
# Arrange image composition
|
|
193
200
|
collage = self.layoutManager.generate([photo.get_image() for photo in photos])
|
|
194
|
-
composition.paste(collage, (
|
|
201
|
+
composition.paste(collage, (self.margin_sides_px, self.margin_top_px))
|
|
195
202
|
|
|
196
203
|
# add location map (if configured and not the title page)
|
|
197
204
|
if self.config.geo.usePhotoLocationMaps.value and not is_title:
|
|
@@ -312,7 +319,7 @@ class CompositionDesigner:
|
|
|
312
319
|
|
|
313
320
|
def save(self, composition: Image.Image, element: str):
|
|
314
321
|
# save with configured quality/dpi
|
|
315
|
-
output_prefix = f"
|
|
322
|
+
output_prefix = f"{element}"
|
|
316
323
|
output_file_name = f"{output_prefix}.jpg"
|
|
317
324
|
output_path = self.outputDir / output_file_name
|
|
318
325
|
jpg_quality = int(self.config.size.jpgQuality.value)
|
|
@@ -51,11 +51,18 @@ class MainGui:
|
|
|
51
51
|
("distribute_group_matching_dates", "Distribute photos by date"),
|
|
52
52
|
]
|
|
53
53
|
|
|
54
|
+
composition_modes = [
|
|
55
|
+
("render_and_pdf", "Render images & generate PDF"),
|
|
56
|
+
("render_only", "Render images only"),
|
|
57
|
+
("pdf_only", "Generate PDF only"),
|
|
58
|
+
]
|
|
59
|
+
|
|
54
60
|
def __init__(self, root, config=None):
|
|
55
61
|
self.root = root
|
|
56
62
|
self.root.title("Photo-Composition-Designer")
|
|
57
63
|
self.root.geometry("1200x800") # Increased width for new layout
|
|
58
64
|
self.root.update_idletasks()
|
|
65
|
+
self._config_path = None
|
|
59
66
|
|
|
60
67
|
# Initialize configuration
|
|
61
68
|
# Prefer the user's last used configuration if present; otherwise
|
|
@@ -68,11 +75,14 @@ class MainGui:
|
|
|
68
75
|
|
|
69
76
|
if last and Path(last).exists():
|
|
70
77
|
self._config = ConfigParameterManager(last)
|
|
78
|
+
self._config_path = last
|
|
71
79
|
elif Path("config.yaml").exists():
|
|
72
80
|
# Load default config but do not persist it as the "last used"
|
|
73
81
|
self._config = ConfigParameterManager("config.yaml", persist_last_used=False)
|
|
82
|
+
self._config_path = "config.yaml"
|
|
74
83
|
else:
|
|
75
84
|
self._config = ConfigParameterManager()
|
|
85
|
+
self._config_path = None
|
|
76
86
|
|
|
77
87
|
# Initialize logging system using individual AppConfig values
|
|
78
88
|
self.logger_manager = initialize_logging(
|
|
@@ -88,6 +98,7 @@ class MainGui:
|
|
|
88
98
|
self._build_widgets()
|
|
89
99
|
self._create_menu()
|
|
90
100
|
self._reload_config()
|
|
101
|
+
self._update_window_title_with_config()
|
|
91
102
|
|
|
92
103
|
# Setup GUI logging after widgets are created
|
|
93
104
|
self._setup_gui_logging()
|
|
@@ -170,30 +181,81 @@ class MainGui:
|
|
|
170
181
|
# Add with weight=0 to keep fixed width
|
|
171
182
|
top_paned.add(button_outer_frame, weight=0)
|
|
172
183
|
|
|
184
|
+
# RIGHT SIDE — FIXED-WIDTH BUTTON PANEL with Workflow Phases
|
|
185
|
+
button_outer_frame = ttk.Frame(top_paned)
|
|
186
|
+
# Add with weight=0 to keep fixed width
|
|
187
|
+
top_paned.add(button_outer_frame, weight=0)
|
|
188
|
+
|
|
173
189
|
# inner frame for padding
|
|
174
190
|
button_frame = ttk.Frame(button_outer_frame)
|
|
175
|
-
button_frame.pack(fill=tk.
|
|
191
|
+
button_frame.pack(fill=tk.BOTH, expand=True, padx=5, pady=5)
|
|
192
|
+
|
|
193
|
+
# ===== PHASE 1: Configuration =====
|
|
194
|
+
phase1_label = ttk.Label(
|
|
195
|
+
button_frame, text="1 Configuration", font=("TkHeadingFont", 10, "bold")
|
|
196
|
+
)
|
|
197
|
+
phase1_label.pack(pady=(10, 5), fill=tk.X)
|
|
176
198
|
|
|
177
|
-
# folder selection
|
|
178
199
|
select_config_button = ttk.Button(
|
|
179
200
|
button_frame, text="Select config file", command=self._select_config
|
|
180
201
|
)
|
|
181
|
-
select_config_button
|
|
202
|
+
ToolTip(select_config_button, "Select and load a configuration file (.yaml)")
|
|
203
|
+
select_config_button.pack(pady=2, fill=tk.X)
|
|
182
204
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
205
|
+
ttk.Separator(button_frame, orient=tk.HORIZONTAL).pack(pady=10, fill=tk.X)
|
|
206
|
+
|
|
207
|
+
# ===== PHASE 2: Image Distribution =====
|
|
208
|
+
phase2_label = ttk.Label(
|
|
209
|
+
button_frame, text="2 Image Distribution", font=("TkHeadingFont", 10, "bold")
|
|
210
|
+
)
|
|
211
|
+
phase2_label.pack(pady=(10, 5), fill=tk.X)
|
|
212
|
+
|
|
213
|
+
# Distribution mode dropdown
|
|
214
|
+
dist_frame = ttk.Frame(button_frame)
|
|
215
|
+
dist_frame.pack(fill=tk.X, pady=2)
|
|
216
|
+
|
|
217
|
+
ttk.Label(dist_frame, text="Method:", width=8).pack(side=tk.LEFT, padx=(0, 5))
|
|
218
|
+
self.distribution_var = tk.StringVar(value="distribute_group_matching_dates")
|
|
219
|
+
# Map IDs to labels for display
|
|
220
|
+
self._dist_mode_map = {mode[0]: mode[1] for mode in self.distribution_modes}
|
|
221
|
+
self.distribution_combo = ttk.Combobox(
|
|
222
|
+
dist_frame,
|
|
223
|
+
textvariable=self.distribution_var,
|
|
224
|
+
values=[self._dist_mode_map[mode[0]] for mode in self.distribution_modes],
|
|
225
|
+
state="readonly",
|
|
226
|
+
width=20,
|
|
227
|
+
)
|
|
228
|
+
self.distribution_combo.pack(side=tk.LEFT, fill=tk.X, expand=True)
|
|
229
|
+
# Set initial display value
|
|
230
|
+
self.distribution_combo.set(self._dist_mode_map["distribute_group_matching_dates"])
|
|
231
|
+
|
|
232
|
+
# Add tooltips for distribution options
|
|
233
|
+
tooltip_text = (
|
|
234
|
+
"by date: Groups photos by their capture date\n"
|
|
235
|
+
"equally: Distributes photos evenly across folders\n"
|
|
236
|
+
"randomly: Distributes photos randomly"
|
|
237
|
+
)
|
|
238
|
+
ToolTip(self.distribution_combo, tooltip_text)
|
|
239
|
+
|
|
240
|
+
# Distribution run button
|
|
241
|
+
self.run_distribution_button = ttk.Button(
|
|
242
|
+
button_frame,
|
|
243
|
+
text="Distribute",
|
|
244
|
+
command=self._run_distribution,
|
|
245
|
+
)
|
|
246
|
+
ToolTip(
|
|
247
|
+
self.run_distribution_button,
|
|
248
|
+
"Execute the selected distribution method\nfor all photos in the source directory",
|
|
249
|
+
)
|
|
250
|
+
self.run_distribution_button.pack(pady=5, fill=tk.X)
|
|
251
|
+
|
|
252
|
+
ttk.Separator(button_frame, orient=tk.HORIZONTAL).pack(pady=10, fill=tk.X)
|
|
253
|
+
|
|
254
|
+
# ===== PHASE 3: Descriptions =====
|
|
255
|
+
phase3_label = ttk.Label(
|
|
256
|
+
button_frame, text="3 Prepare Description File", font=("TkHeadingFont", 10, "bold")
|
|
257
|
+
)
|
|
258
|
+
phase3_label.pack(pady=(10, 5), fill=tk.X)
|
|
197
259
|
|
|
198
260
|
# description file button
|
|
199
261
|
self.generate_description_file_button = ttk.Button(
|
|
@@ -203,20 +265,79 @@ class MainGui:
|
|
|
203
265
|
)
|
|
204
266
|
ToolTip(
|
|
205
267
|
self.generate_description_file_button,
|
|
206
|
-
"Generate a template description file for all collages
|
|
268
|
+
"Generate a template description file for all collages\n"
|
|
207
269
|
"based on the generated photo directories",
|
|
208
270
|
)
|
|
209
|
-
self.generate_description_file_button.pack(pady=
|
|
271
|
+
self.generate_description_file_button.pack(pady=2, fill=tk.X)
|
|
210
272
|
|
|
211
|
-
|
|
212
|
-
|
|
273
|
+
ttk.Separator(button_frame, orient=tk.HORIZONTAL).pack(pady=10, fill=tk.X)
|
|
274
|
+
|
|
275
|
+
# ===== PHASE 4: Composition & Export =====
|
|
276
|
+
phase4_label = ttk.Label(
|
|
277
|
+
button_frame, text="4 Composition & Export", font=("TkHeadingFont", 10, "bold")
|
|
278
|
+
)
|
|
279
|
+
phase4_label.pack(pady=(10, 5), fill=tk.X)
|
|
280
|
+
|
|
281
|
+
# Composition mode dropdown
|
|
282
|
+
comp_frame = ttk.Frame(button_frame)
|
|
283
|
+
comp_frame.pack(fill=tk.X, pady=2)
|
|
284
|
+
|
|
285
|
+
ttk.Label(comp_frame, text="Action:", width=8).pack(side=tk.LEFT, padx=(0, 5))
|
|
286
|
+
self.composition_var = tk.StringVar(value="render_and_pdf")
|
|
287
|
+
# Map IDs to labels for display
|
|
288
|
+
self._comp_mode_map = {mode[0]: mode[1] for mode in self.composition_modes}
|
|
289
|
+
self.composition_combo = ttk.Combobox(
|
|
290
|
+
comp_frame,
|
|
291
|
+
textvariable=self.composition_var,
|
|
292
|
+
values=[self._comp_mode_map[mode[0]] for mode in self.composition_modes],
|
|
293
|
+
state="readonly",
|
|
294
|
+
width=20,
|
|
295
|
+
)
|
|
296
|
+
self.composition_combo.pack(side=tk.LEFT, fill=tk.X, expand=True)
|
|
297
|
+
# Set initial display value
|
|
298
|
+
self.composition_combo.set(self._comp_mode_map["render_and_pdf"])
|
|
299
|
+
|
|
300
|
+
# Add tooltips for composition options
|
|
301
|
+
tooltip_text = (
|
|
302
|
+
"Render+PDF: Generate all composition images AND create PDF\n"
|
|
303
|
+
"Render only: Generate composition images without PDF\n"
|
|
304
|
+
"PDF only: Create PDF from existing composition images"
|
|
305
|
+
)
|
|
306
|
+
ToolTip(self.composition_combo, tooltip_text)
|
|
307
|
+
|
|
308
|
+
# Composition run button
|
|
309
|
+
self.run_composition_button = ttk.Button(
|
|
213
310
|
button_frame,
|
|
214
|
-
text="Generate
|
|
215
|
-
command=self.
|
|
311
|
+
text="Generate",
|
|
312
|
+
command=self._run_generate_compositions,
|
|
216
313
|
)
|
|
217
|
-
|
|
314
|
+
ToolTip(
|
|
315
|
+
self.run_composition_button,
|
|
316
|
+
"Execute the selected composition action\n"
|
|
317
|
+
"This may take a while depending on the number of images",
|
|
318
|
+
)
|
|
319
|
+
self.run_composition_button.pack(pady=5, fill=tk.X)
|
|
320
|
+
|
|
321
|
+
ttk.Separator(button_frame, orient=tk.HORIZONTAL).pack(pady=10, fill=tk.X)
|
|
322
|
+
|
|
323
|
+
# ===== PHASE 4: Preview & Descriptions =====
|
|
324
|
+
phase4_label = ttk.Label(button_frame, text="Preview", font=("TkHeadingFont", 10, "bold"))
|
|
325
|
+
phase4_label.pack(pady=(10, 5), fill=tk.X)
|
|
218
326
|
|
|
219
|
-
|
|
327
|
+
self.render_preview_button = ttk.Button(
|
|
328
|
+
button_frame,
|
|
329
|
+
text="Render Current Preview",
|
|
330
|
+
command=self._render_and_save_preview,
|
|
331
|
+
)
|
|
332
|
+
ToolTip(
|
|
333
|
+
self.render_preview_button,
|
|
334
|
+
"Render the currently selected preview\nand save it to the compose output folder",
|
|
335
|
+
)
|
|
336
|
+
self.render_preview_button.pack(pady=2, fill=tk.X)
|
|
337
|
+
|
|
338
|
+
ttk.Separator(button_frame, orient=tk.HORIZONTAL).pack(pady=10, fill=tk.X)
|
|
339
|
+
|
|
340
|
+
# ===== Progress Bar =====
|
|
220
341
|
self.progress = ttk.Progressbar(button_frame, mode="determinate")
|
|
221
342
|
self.progress.pack(
|
|
222
343
|
pady=10,
|
|
@@ -461,12 +582,164 @@ class MainGui:
|
|
|
461
582
|
self.logger.info(f"Loading new configuration from: {config_file}")
|
|
462
583
|
try:
|
|
463
584
|
self._config = ConfigParameterManager(config_file)
|
|
585
|
+
self._config_path = config_file
|
|
464
586
|
self._reload_config()
|
|
465
587
|
self._generate_preview(0)
|
|
588
|
+
self._update_window_title_with_config()
|
|
466
589
|
except Exception as e:
|
|
467
590
|
self.logger.error(f"Failed to load config file: {e}", exc_info=True)
|
|
468
591
|
messagebox.showerror("Config Error", f"Failed to load configuration: {e}")
|
|
469
592
|
|
|
593
|
+
def _update_window_title_with_config(self):
|
|
594
|
+
"""Update window title to show the relative path to the config file."""
|
|
595
|
+
if self._config_path:
|
|
596
|
+
try:
|
|
597
|
+
config_path = Path(self._config_path)
|
|
598
|
+
# Try to get relative path from current working directory
|
|
599
|
+
try:
|
|
600
|
+
rel_path = config_path.relative_to(Path.cwd())
|
|
601
|
+
except ValueError:
|
|
602
|
+
# If not relative to cwd, use the absolute path
|
|
603
|
+
rel_path = config_path
|
|
604
|
+
self.root.title(f"Photo-Composition-Designer - Config: {rel_path}")
|
|
605
|
+
except Exception as e:
|
|
606
|
+
self.logger.debug(f"Could not set title with config path: {e}")
|
|
607
|
+
self.root.title("Photo-Composition-Designer")
|
|
608
|
+
else:
|
|
609
|
+
self.root.title("Photo-Composition-Designer")
|
|
610
|
+
|
|
611
|
+
def _run_distribution(self):
|
|
612
|
+
"""Run image distribution using the selected mode from dropdown."""
|
|
613
|
+
# Map displayed label back to mode ID
|
|
614
|
+
display_label = self.distribution_var.get()
|
|
615
|
+
mode_id = next(
|
|
616
|
+
(mode[0] for mode in self.distribution_modes if mode[1] == display_label),
|
|
617
|
+
"distribute_group_matching_dates",
|
|
618
|
+
)
|
|
619
|
+
self.logger.info(f"Starting distribution in mode: {mode_id}")
|
|
620
|
+
self._run_processing_image_distribution(mode_id)
|
|
621
|
+
|
|
622
|
+
def _render_and_save_preview(self):
|
|
623
|
+
"""Render the currently selected preview and save it."""
|
|
624
|
+
selection = self.photo_dir_listbox.curselection()
|
|
625
|
+
if not selection:
|
|
626
|
+
messagebox.showwarning(
|
|
627
|
+
"No Selection", "Please select a photo folder to render its preview."
|
|
628
|
+
)
|
|
629
|
+
return
|
|
630
|
+
|
|
631
|
+
selection_index = selection[0]
|
|
632
|
+
if not self.photo_folders:
|
|
633
|
+
messagebox.showwarning("No Folders", "No photo folders available.")
|
|
634
|
+
return
|
|
635
|
+
|
|
636
|
+
folder_name = self.photo_folders[selection_index].name
|
|
637
|
+
|
|
638
|
+
self.logger.info(f"Rendering and saving preview for folder: {folder_name}")
|
|
639
|
+
|
|
640
|
+
self._start_processing()
|
|
641
|
+
|
|
642
|
+
# Run in separate thread to avoid blocking GUI
|
|
643
|
+
thread = threading.Thread(
|
|
644
|
+
target=self._render_preview_thread,
|
|
645
|
+
args=(folder_name,),
|
|
646
|
+
daemon=True,
|
|
647
|
+
)
|
|
648
|
+
thread.start()
|
|
649
|
+
|
|
650
|
+
def _render_preview_thread(self, folder_name):
|
|
651
|
+
"""Threaded backend for rendering and saving preview."""
|
|
652
|
+
try:
|
|
653
|
+
self.logger.info(f"Generating and saving preview for: {folder_name}")
|
|
654
|
+
|
|
655
|
+
# Generate the preview image
|
|
656
|
+
preview_designer = CompositionDesigner(self._config, self.logger)
|
|
657
|
+
preview_image = preview_designer.generate_compositions_from_folder(folder_name)
|
|
658
|
+
|
|
659
|
+
if not preview_image:
|
|
660
|
+
self.logger.warning(f"Could not generate preview for {folder_name}")
|
|
661
|
+
self.root.after(
|
|
662
|
+
0,
|
|
663
|
+
lambda: messagebox.showwarning(
|
|
664
|
+
"Error", f"Could not generate preview for folder {folder_name}"
|
|
665
|
+
),
|
|
666
|
+
)
|
|
667
|
+
return
|
|
668
|
+
|
|
669
|
+
# Save the image to the output folder
|
|
670
|
+
output_dir = preview_designer.outputDir
|
|
671
|
+
output_file = output_dir / f"{folder_name}.jpg"
|
|
672
|
+
preview_image.save(output_file, quality=95)
|
|
673
|
+
self.logger.info(f"Preview saved to: {output_file}")
|
|
674
|
+
|
|
675
|
+
except Exception as e:
|
|
676
|
+
self.logger.error(f"Error rendering preview: {e}", exc_info=True)
|
|
677
|
+
self.root.after(
|
|
678
|
+
0,
|
|
679
|
+
lambda err=e: messagebox.showerror("Error", f"Preview rendering failed: {err}"),
|
|
680
|
+
)
|
|
681
|
+
|
|
682
|
+
finally:
|
|
683
|
+
# Re-enable controls in main thread
|
|
684
|
+
self.root.after(0, self._processing_finished)
|
|
685
|
+
|
|
686
|
+
def _run_generate_compositions(self):
|
|
687
|
+
"""Run composition generation using the selected mode from dropdown."""
|
|
688
|
+
# Map displayed label back to mode ID
|
|
689
|
+
display_label = self.composition_var.get()
|
|
690
|
+
mode_id = next(
|
|
691
|
+
(mode[0] for mode in self.composition_modes if mode[1] == display_label),
|
|
692
|
+
"render_and_pdf",
|
|
693
|
+
)
|
|
694
|
+
self.logger.info(f"Starting composition generation in mode: {mode_id}")
|
|
695
|
+
|
|
696
|
+
self._start_processing()
|
|
697
|
+
thread = threading.Thread(
|
|
698
|
+
target=self._generate_compositions_thread,
|
|
699
|
+
args=(mode_id,),
|
|
700
|
+
daemon=True,
|
|
701
|
+
)
|
|
702
|
+
thread.start()
|
|
703
|
+
|
|
704
|
+
def _generate_compositions_thread(self, mode="render_and_pdf"):
|
|
705
|
+
"""Threaded backend for composition generation with different modes."""
|
|
706
|
+
try:
|
|
707
|
+
self.logger.info(f"Generate compositions in mode: {mode}")
|
|
708
|
+
|
|
709
|
+
if mode == "render_and_pdf":
|
|
710
|
+
# Generate all compositions and PDF (default/original behavior)
|
|
711
|
+
self.composition_designer.generate_compositions_from_folders()
|
|
712
|
+
elif mode == "render_only":
|
|
713
|
+
# Generate compositions without PDF
|
|
714
|
+
# Temporarily disable PDF generation
|
|
715
|
+
original_pdf_setting = self._config.layout.generatePdf.value
|
|
716
|
+
self._config.layout.generatePdf.value = False
|
|
717
|
+
try:
|
|
718
|
+
self.composition_designer.generate_compositions_from_folders()
|
|
719
|
+
finally:
|
|
720
|
+
# Restore original setting
|
|
721
|
+
self._config.layout.generatePdf.value = original_pdf_setting
|
|
722
|
+
elif mode == "pdf_only":
|
|
723
|
+
# Generate PDF from existing composition images
|
|
724
|
+
self.composition_designer.generate_pdf(self.composition_designer.outputDir)
|
|
725
|
+
else:
|
|
726
|
+
self.logger.warning(f"Unknown composition mode: {mode}")
|
|
727
|
+
|
|
728
|
+
self.logger.info("Composition generation completed")
|
|
729
|
+
|
|
730
|
+
except Exception as e:
|
|
731
|
+
self.logger.error(f"Error generating compositions: {e}", exc_info=True)
|
|
732
|
+
self.root.after(
|
|
733
|
+
0,
|
|
734
|
+
lambda err=e: messagebox.showerror(
|
|
735
|
+
"Error", f"Composition generation failed: {err}"
|
|
736
|
+
),
|
|
737
|
+
)
|
|
738
|
+
|
|
739
|
+
finally:
|
|
740
|
+
# Re-enable controls in main thread
|
|
741
|
+
self.root.after(0, self._processing_finished)
|
|
742
|
+
|
|
470
743
|
def _run_processing_image_distribution(self, mode="distribute_group_matching_dates"):
|
|
471
744
|
"""Run the processing in a separate thread."""
|
|
472
745
|
|
|
@@ -546,20 +819,25 @@ class MainGui:
|
|
|
546
819
|
self.root.after(0, self._processing_finished)
|
|
547
820
|
|
|
548
821
|
def _start_processing(self):
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
822
|
+
"""Disable all buttons during processing."""
|
|
823
|
+
self.run_distribution_button.config(state="disabled")
|
|
824
|
+
self.run_composition_button.config(state="disabled")
|
|
825
|
+
self.render_preview_button.config(state="disabled")
|
|
826
|
+
self.generate_description_file_button.config(state="disabled")
|
|
827
|
+
self.distribution_combo.config(state="disabled")
|
|
828
|
+
self.composition_combo.config(state="disabled")
|
|
552
829
|
|
|
553
|
-
self.generate_compositions_button.config(state="disabled")
|
|
554
830
|
self.progress.configure(value=0, maximum=100)
|
|
555
|
-
# self.progress.start()
|
|
556
831
|
|
|
557
832
|
def _processing_finished(self):
|
|
558
833
|
"""Re-enable controls after processing is finished."""
|
|
559
|
-
|
|
560
|
-
|
|
834
|
+
self.run_distribution_button.config(state="normal")
|
|
835
|
+
self.run_composition_button.config(state="normal")
|
|
836
|
+
self.render_preview_button.config(state="normal")
|
|
837
|
+
self.generate_description_file_button.config(state="normal")
|
|
838
|
+
self.distribution_combo.config(state="readonly")
|
|
839
|
+
self.composition_combo.config(state="readonly")
|
|
561
840
|
|
|
562
|
-
self.generate_compositions_button.config(state="normal")
|
|
563
841
|
self.progress.stop()
|
|
564
842
|
self.progress.configure(value=0)
|
|
565
843
|
|
|
@@ -189,14 +189,9 @@ class CollageRenderer:
|
|
|
189
189
|
def _generateTwoImageLayout(
|
|
190
190
|
self,
|
|
191
191
|
images,
|
|
192
|
-
|
|
193
|
-
height,
|
|
192
|
+
direction="horizontal",
|
|
194
193
|
):
|
|
195
194
|
|
|
196
|
-
is_portrait_canvas = height > width
|
|
197
|
-
|
|
198
|
-
direction = "horizontal" if is_portrait_canvas else "vertical"
|
|
199
|
-
|
|
200
195
|
return SplitNode(
|
|
201
196
|
direction=direction,
|
|
202
197
|
children=[
|
|
@@ -209,7 +204,12 @@ class CollageRenderer:
|
|
|
209
204
|
],
|
|
210
205
|
)
|
|
211
206
|
|
|
212
|
-
def
|
|
207
|
+
def _get_splitter_direction(self, width, height) -> str:
|
|
208
|
+
is_portrait_canvas = height > width
|
|
209
|
+
direction = "horizontal" if is_portrait_canvas else "vertical"
|
|
210
|
+
return direction
|
|
211
|
+
|
|
212
|
+
def _chooseBestThreeLayout(self, images, direction="horizontal"):
|
|
213
213
|
ratios = [img.width / img.height for img in images]
|
|
214
214
|
|
|
215
215
|
is_portrait = [r < 0.9 for r in ratios]
|
|
@@ -217,8 +217,8 @@ class CollageRenderer:
|
|
|
217
217
|
|
|
218
218
|
weights = [self._calculateCombinedWeight(img) for img in images]
|
|
219
219
|
|
|
220
|
-
# --- FALL 1.1: PPP
|
|
221
|
-
if p_count == 3:
|
|
220
|
+
# --- FALL 1.1: PPP ---
|
|
221
|
+
if p_count == 3 and direction == "vertical":
|
|
222
222
|
return SplitNode(
|
|
223
223
|
direction="vertical",
|
|
224
224
|
children=[
|
|
@@ -241,24 +241,6 @@ class CollageRenderer:
|
|
|
241
241
|
weights=weights,
|
|
242
242
|
)
|
|
243
243
|
|
|
244
|
-
# --- FALL 2: PLL (Eins hochkant, zwei quer) ---
|
|
245
|
-
if p_count == 4:
|
|
246
|
-
return SplitNode(
|
|
247
|
-
direction="horizontal",
|
|
248
|
-
children=[
|
|
249
|
-
SplitNode(
|
|
250
|
-
direction="vertical",
|
|
251
|
-
children=[
|
|
252
|
-
ImageNode(images[0]),
|
|
253
|
-
ImageNode(images[1]),
|
|
254
|
-
],
|
|
255
|
-
weights=[weights[0], weights[1]],
|
|
256
|
-
),
|
|
257
|
-
ImageNode(images[2]),
|
|
258
|
-
],
|
|
259
|
-
weights=[(weights[0] + weights[1]) / 2, weights[2]],
|
|
260
|
-
)
|
|
261
|
-
|
|
262
244
|
# --- FALL 3: mixed (1P2L / 2P1L) ---
|
|
263
245
|
if p_count in (1, 2):
|
|
264
246
|
portraits = []
|
|
@@ -271,7 +253,7 @@ class CollageRenderer:
|
|
|
271
253
|
landscapes.append((img, w))
|
|
272
254
|
|
|
273
255
|
# --- FALL: 1 Portrait + 2 Landscape ---
|
|
274
|
-
if len(portraits) == 1 and len(landscapes) == 2:
|
|
256
|
+
if len(portraits) == 1 and len(landscapes) == 2 and direction == "vertical":
|
|
275
257
|
p_img, p_w = portraits[0]
|
|
276
258
|
l1, l2 = landscapes
|
|
277
259
|
|
|
@@ -288,7 +270,7 @@ class CollageRenderer:
|
|
|
288
270
|
weights=[l1[1], l2[1]],
|
|
289
271
|
),
|
|
290
272
|
],
|
|
291
|
-
weights=[p_w, (l1[1] + l2[1]) /
|
|
273
|
+
weights=[p_w, (l1[1] + l2[1]) / 4],
|
|
292
274
|
)
|
|
293
275
|
|
|
294
276
|
# --- FALL: 2 Portrait + 1 Landscape ---
|
|
@@ -326,7 +308,7 @@ class CollageRenderer:
|
|
|
326
308
|
weights=[weights[1], weights[2]],
|
|
327
309
|
),
|
|
328
310
|
],
|
|
329
|
-
weights=[weights[0], weights[1] + weights[2]],
|
|
311
|
+
weights=[weights[0] * 2, weights[1] + weights[2]],
|
|
330
312
|
)
|
|
331
313
|
|
|
332
314
|
def _generateLayout(self, images, target_width, target_height):
|
|
@@ -336,15 +318,16 @@ class CollageRenderer:
|
|
|
336
318
|
"""
|
|
337
319
|
|
|
338
320
|
n = len(images)
|
|
321
|
+
direction = self._get_splitter_direction(target_width, target_height)
|
|
339
322
|
|
|
340
323
|
if n == 1:
|
|
341
324
|
return ImageNode(images[0])
|
|
342
325
|
|
|
343
326
|
if n == 2:
|
|
344
|
-
return self._generateTwoImageLayout(images,
|
|
327
|
+
return self._generateTwoImageLayout(images, direction)
|
|
345
328
|
|
|
346
329
|
if n == 3:
|
|
347
|
-
return self._chooseBestThreeLayout(images,
|
|
330
|
+
return self._chooseBestThreeLayout(images, direction)
|
|
348
331
|
|
|
349
332
|
# Special handling for 4 images: prefer nested/grouped layouts similar to
|
|
350
333
|
# PhotoCollage.makeCollage. This results in nicer, more balanced
|
|
@@ -352,25 +335,17 @@ class CollageRenderer:
|
|
|
352
335
|
# on the other, or two nested groups of two images).
|
|
353
336
|
portraits = [img for img in images if img.width < img.height]
|
|
354
337
|
landscapes = [img for img in images if img.width >= img.height]
|
|
355
|
-
if n == 4 and len(portraits) == 1 and
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
p_img
|
|
365
|
-
|
|
366
|
-
left_node = ImageNode(p_img)
|
|
367
|
-
# choose split direction according to canvas ratio
|
|
368
|
-
direction = "vertical" if target_width >= target_height else "horizontal"
|
|
369
|
-
return SplitNode(
|
|
370
|
-
direction=direction,
|
|
371
|
-
children=[left_node, right_node],
|
|
372
|
-
weights=[self._calculateLayoutWeight(p_img) * 2, group_weight(landscapes)],
|
|
373
|
-
)
|
|
338
|
+
if n == 4 and len(portraits) == 1 and direction == "vertical":
|
|
339
|
+
p_img = portraits[0]
|
|
340
|
+
right_node = self._chooseBestThreeLayout(landscapes, direction)
|
|
341
|
+
left_node = ImageNode(p_img)
|
|
342
|
+
# choose split direction according to canvas ratio
|
|
343
|
+
# direction = "vertical" if target_width >= target_height else "horizontal"
|
|
344
|
+
return SplitNode(
|
|
345
|
+
direction=direction,
|
|
346
|
+
children=[left_node, right_node],
|
|
347
|
+
weights=[self._calculateLayoutWeight(p_img) * 2, 1],
|
|
348
|
+
)
|
|
374
349
|
|
|
375
350
|
# Gewichte berechnen (wie vorher)
|
|
376
351
|
weights = [self._calculateLayoutWeight(img) for img in images]
|
|
@@ -378,6 +353,8 @@ class CollageRenderer:
|
|
|
378
353
|
# Ziel: Anzahl "Zeilen" heuristisch bestimmen
|
|
379
354
|
canvas_ratio = target_width / target_height
|
|
380
355
|
num_rows = max(1, min(n, int(round(math.sqrt(n / canvas_ratio)))))
|
|
356
|
+
if n == 4 and len(portraits) == 1:
|
|
357
|
+
num_rows = 3
|
|
381
358
|
|
|
382
359
|
# Partitionierung (wie im Referenzalgorithmus)
|
|
383
360
|
rows = linear_partition(weights, num_rows, images)
|