From b6455a4bcbc4ab32349f16a313a258ac3e6ffa33 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 16 Feb 2026 22:07:50 +0100 Subject: [PATCH 01/69] Added windows runner --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ba6ff4..726ed8e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,10 @@ variables: build_windows: stage: build tags: + - saas-windows-medium-amd64 - shared-windows + - windows + - windows-1809 script: - dotnet --info - dotnet restore @@ -35,7 +38,10 @@ build_windows: publish_release: stage: publish tags: + - saas-windows-medium-amd64 - shared-windows + - windows + - windows-1809 needs: - build_windows script: From 3898c002f2ed3e78b6c0e8d1e40e0143959225f7 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 16 Feb 2026 22:17:43 +0100 Subject: [PATCH 02/69] Fixed shared runner tag --- .gitlab-ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 726ed8e..203d04b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,9 +22,6 @@ build_windows: stage: build tags: - saas-windows-medium-amd64 - - shared-windows - - windows - - windows-1809 script: - dotnet --info - dotnet restore @@ -39,9 +36,6 @@ publish_release: stage: publish tags: - saas-windows-medium-amd64 - - shared-windows - - windows - - windows-1809 needs: - build_windows script: From 90c50358d1d2271d2da8c7f341d69be598961174 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 16 Feb 2026 22:31:13 +0100 Subject: [PATCH 03/69] Install .net sdk 10 on runner --- .gitlab-ci.yml | 64 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 203d04b..ccd81de 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,9 +23,23 @@ build_windows: tags: - saas-windows-medium-amd64 script: - - dotnet --info - - dotnet restore - - dotnet build "imagecatalog\ImageCatalog 2.csproj" -c $BUILD_CONFIG -v minimal + - | + powershell -NoProfile -Command { + $needsInstall = -not (dotnet --list-sdks 2>$null | Select-String '^10\.') + if ($needsInstall) { + Write-Host 'Installing .NET 10 SDK using dotnet-install.ps1' + Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile dotnet-install.ps1 -UseBasicParsing + .\dotnet-install.ps1 -Channel 10.0 -InstallDir $env:USERPROFILE\.dotnet + $dotnetExe = Join-Path $env:USERPROFILE '.dotnet\dotnet.exe' + } else { + Write-Host '.NET 10 SDK already present on PATH' + $dotnetExe = 'dotnet' + } + + & $dotnetExe --info + & $dotnetExe restore + & $dotnetExe build "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -v minimal + } artifacts: paths: - "**/bin/$BUILD_CONFIG/net10.0-windows/**" @@ -39,21 +53,35 @@ publish_release: needs: - build_windows script: - # Publish the app - - dotnet publish "imagecatalog\ImageCatalog 2.csproj" -c $BUILD_CONFIG -r win-x64 --self-contained false -o publish - - echo "Published to $(pwd)\\publish" - # Find first file in publish folder - - $file = Get-ChildItem -Path publish -File | Select-Object -First 1; Write-Host "Uploading $($file.FullName)" - # Upload to GitLab project uploads API to get a public URL for the artifact - - $uploadUrl = "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/uploads" - - $formData = "file=@$($file.FullName)" - - $uploadResp = curl --silent --show-error --header "JOB-TOKEN:$env:CI_JOB_TOKEN" --form $formData $uploadUrl - - $uploadJson = $uploadResp | ConvertFrom-Json - - $assetUrl = "$env:CI_SERVER_URL$($uploadJson.url)" - - 'Write-Host "Uploaded asset url: $assetUrl"' - # Create the release using uploads URL - - $body = @{ name = $env:CI_COMMIT_TAG; tag_name = $env:CI_COMMIT_TAG; description = "Automated release from CI"; assets = @{ links = @(@{ name = "$($file.Name)"; url = $assetUrl }) } } | ConvertTo-Json -Depth 10 - - Invoke-RestMethod -Method Post -Uri "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/releases" -Headers @{ "JOB-TOKEN" = $env:CI_JOB_TOKEN } -Body $body -ContentType "application/json" + - | + powershell -NoProfile -Command { + # Ensure .NET 10 SDK is available (install to user folder if missing) and use that dotnet for publish + $needsInstall = -not (dotnet --list-sdks 2>$null | Select-String '^10\.') + if ($needsInstall) { + Write-Host 'Installing .NET 10 SDK using dotnet-install.ps1' + Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile dotnet-install.ps1 -UseBasicParsing + .\dotnet-install.ps1 -Channel 10.0 -InstallDir $env:USERPROFILE\.dotnet + $dotnetExe = Join-Path $env:USERPROFILE '.dotnet\dotnet.exe' + } else { + $dotnetExe = 'dotnet' + } + + & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -r win-x64 --self-contained false -o publish + Write-Host "Published to $(pwd)\\publish" + + # Find first file in publish folder + $file = Get-ChildItem -Path publish -File | Select-Object -First 1; Write-Host "Uploading $($file.FullName)" + # Upload to GitLab project uploads API to get a public URL for the artifact + $uploadUrl = "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/uploads" + $formData = "file=@$($file.FullName)" + $uploadResp = curl --silent --show-error --header "JOB-TOKEN:$env:CI_JOB_TOKEN" --form $formData $uploadUrl + $uploadJson = $uploadResp | ConvertFrom-Json + $assetUrl = "$env:CI_SERVER_URL$($uploadJson.url)" + Write-Host "Uploaded asset url: $assetUrl" + # Create the release using uploads URL + $body = @{ name = $env:CI_COMMIT_TAG; tag_name = $env:CI_COMMIT_TAG; description = "Automated release from CI"; assets = @{ links = @(@{ name = "$($file.Name)"; url = $assetUrl }) } } | ConvertTo-Json -Depth 10 + Invoke-RestMethod -Method Post -Uri "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/releases" -Headers @{ "JOB-TOKEN" = $env:CI_JOB_TOKEN } -Body $body -ContentType "application/json" + } artifacts: paths: - publish/* From 38cf61ab33066d0ae52df5971fd19a369c3364d9 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 16 Feb 2026 22:53:48 +0100 Subject: [PATCH 04/69] Added variables for nuget --- .gitlab-ci.yml | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ccd81de..87cac98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,18 +4,26 @@ stages: # Only create pipelines automatically when a Git tag is pushed. # Otherwise the pipeline must be started manually (pipeline "Run" / dispatch equivalent). -workflow: - rules: - - if: '$CI_COMMIT_TAG' - when: always - - if: '$CI_PIPELINE_SOURCE == "web"' - when: always - - when: never +# workflow: +# rules: +# - if: '$CI_COMMIT_TAG' +# when: always +# - if: '$CI_PIPELINE_SOURCE == "web"' +# when: always +# - when: never variables: DOTNET_CLI_TELEMETRY_OPTOUT: "1" DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" BUILD_CONFIG: "Release" + # NOTE: This project uses repository variables for NuGet auth because secrets + # (masked/protected variables) may not be available on your GitLab plan. + # Replace the placeholders below with values in the repository, or override + # them in your project CI/CD variables when available. + # - NUGET_USERNAME : username (can be any value when using a PAT) + # - NUGET_PASSWORD : personal access token or project deploy token + NUGET_USERNAME: "REPLACE_WITH_USERNAME" + NUGET_PASSWORD: "REPLACE_WITH_TOKEN" # Build job for Windows runner (shell executor). Remove 'image' so the runner uses the host environment. build_windows: @@ -36,6 +44,16 @@ build_windows: $dotnetExe = 'dotnet' } + # Configure private NuGet source from GitLab Packages if credentials are provided + $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' + if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { + Write-Host 'Configuring private NuGet source GitLab...' + try { & $dotnetExe nuget remove source GitLab } catch {} + & $dotnetExe nuget add source $nugetUrl --name GitLab --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + } else { + Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' + } + & $dotnetExe --info & $dotnetExe restore & $dotnetExe build "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -v minimal @@ -69,6 +87,16 @@ publish_release: & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -r win-x64 --self-contained false -o publish Write-Host "Published to $(pwd)\\publish" + # Configure private NuGet source from GitLab Packages if credentials are provided + $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' + if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { + Write-Host 'Configuring private NuGet source GitLab...' + try { & $dotnetExe nuget remove source GitLab } catch {} + & $dotnetExe nuget add source $nugetUrl --name GitLab --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + } else { + Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' + } + # Find first file in publish folder $file = Get-ChildItem -Path publish -File | Select-Object -First 1; Write-Host "Uploading $($file.FullName)" # Upload to GitLab project uploads API to get a public URL for the artifact From e556d74fd1027c518da6623f0e9152930336675e Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 16 Feb 2026 23:12:57 +0100 Subject: [PATCH 05/69] Update NuGet source config and add packageSourceMapping Renamed the private NuGet source from 'GitLab' to 'Nuget-GitLab-AIFotoONLUS' in CI scripts for clarity and consistency. Added a repository-level NuGet.Config with packageSourceMapping to ensure only specific private packages are restored from the GitLab feed, preventing 401 errors when restoring public packages from nuget.org. --- .gitlab-ci.yml | 12 ++++++------ NuGet.Config | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 NuGet.Config diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 87cac98..96c9831 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,9 +47,9 @@ build_windows: # Configure private NuGet source from GitLab Packages if credentials are provided $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { - Write-Host 'Configuring private NuGet source GitLab...' - try { & $dotnetExe nuget remove source GitLab } catch {} - & $dotnetExe nuget add source $nugetUrl --name GitLab --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS...' + try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text } else { Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' } @@ -90,9 +90,9 @@ publish_release: # Configure private NuGet source from GitLab Packages if credentials are provided $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { - Write-Host 'Configuring private NuGet source GitLab...' - try { & $dotnetExe nuget remove source GitLab } catch {} - & $dotnetExe nuget add source $nugetUrl --name GitLab --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS...' + try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text } else { Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' } diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..79cf275 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + From c8d625855652c7551085c18f42ddd34470a59fcc Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 16 Feb 2026 23:26:17 +0100 Subject: [PATCH 06/69] Changed nuget credentials to the CI token --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 96c9831..55d000a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,7 +49,7 @@ build_windows: if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS...' try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} - & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text } else { Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' } @@ -92,7 +92,7 @@ publish_release: if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS...' try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} - & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text } else { Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' } From 4569e001c86e70d76689f714d026d6d6c3fc7755 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 16 Feb 2026 23:54:32 +0100 Subject: [PATCH 07/69] Update NuGet auth to use CI_JOB_TOKEN in CI scripts Switched private NuGet source authentication in build_windows and publish_release jobs to use CI_JOB_TOKEN instead of NUGET_USERNAME/NUGET_PASSWORD. Updated related log messages and ensured PowerShell variable usage is correct for environment variables. This improves compatibility with GitLab CI best practices. --- .gitlab-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55d000a..8a7267c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,14 +44,14 @@ build_windows: $dotnetExe = 'dotnet' } - # Configure private NuGet source from GitLab Packages if credentials are provided + # Configure private NuGet source from GitLab Packages using CI_JOB_TOKEN $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' - if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { - Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS...' + if ($env:CI_JOB_TOKEN) { + Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using CI_JOB_TOKEN...' try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} - & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text } else { - Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' + Write-Host 'CI_JOB_TOKEN not available; skipping private NuGet source configuration.' } & $dotnetExe --info @@ -87,14 +87,14 @@ publish_release: & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -r win-x64 --self-contained false -o publish Write-Host "Published to $(pwd)\\publish" - # Configure private NuGet source from GitLab Packages if credentials are provided + # Configure private NuGet source from GitLab Packages using CI_JOB_TOKEN $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' - if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { - Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS...' + if ($env:CI_JOB_TOKEN) { + Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using CI_JOB_TOKEN...' try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} - & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text } else { - Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' + Write-Host 'CI_JOB_TOKEN not available; skipping private NuGet source configuration.' } # Find first file in publish folder From 8db7ee8075ad58582b0533e3cc7aa008d61a9e8d Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Tue, 17 Feb 2026 00:07:55 +0100 Subject: [PATCH 08/69] Support NuGet auth fallback and add feed diagnostics Enhance private NuGet source setup in build_windows and publish_release jobs to support fallback authentication using NUGET_USERNAME/NUGET_PASSWORD when CI_JOB_TOKEN is unavailable. Update log messages for clarity. Add diagnostic steps in build_windows to verify NuGet feed and package visibility using configured credentials. No changes to core build or publish logic. --- .gitlab-ci.yml | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a7267c..a7ae755 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,16 +45,44 @@ build_windows: } # Configure private NuGet source from GitLab Packages using CI_JOB_TOKEN + # Fallback to repository variables NUGET_USERNAME/NUGET_PASSWORD for shared runners $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' + $authMode = $null if ($env:CI_JOB_TOKEN) { Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using CI_JOB_TOKEN...' try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text + $authMode = 'JobToken' + } elseif ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { + Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using NUGET_USERNAME/NUGET_PASSWORD...' + try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + $authMode = 'UserCreds' } else { - Write-Host 'CI_JOB_TOKEN not available; skipping private NuGet source configuration.' + Write-Host 'No credentials available; skipping private NuGet source configuration.' } & $dotnetExe --info + # Diagnostic: verify GitLab NuGet feed and package visibility using configured auth + if ($authMode) { + Write-Host 'Checking GitLab NuGet feed index and project packages for AIFotoONLUS.Core using auth mode:' $authMode + try { + if ($authMode -eq 'JobToken') { + $headers = @{ 'JOB-TOKEN' = $env:CI_JOB_TOKEN } + } else { + $pair = "$env:NUGET_USERNAME:$env:NUGET_PASSWORD" + $b64 = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair)) + $headers = @{ Authorization = "Basic $b64" } + } + Invoke-RestMethod -Uri $nugetUrl -Headers $headers -Method Get | ConvertTo-Json | Write-Host + } catch { Write-Host "Failed to fetch feed index: $_" } + try { + $pkgApi = "https://gitlab.com/api/v4/projects/79509532/packages?package_name=AIFotoONLUS.Core" + Invoke-RestMethod -Uri $pkgApi -Headers $headers -Method Get | ConvertTo-Json | Write-Host + } catch { Write-Host "Failed to query project packages API: $_" } + } else { + Write-Host 'Skipping feed diagnostics because no auth configured.' + } & $dotnetExe restore & $dotnetExe build "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -v minimal } @@ -88,13 +116,18 @@ publish_release: Write-Host "Published to $(pwd)\\publish" # Configure private NuGet source from GitLab Packages using CI_JOB_TOKEN + # Fallback to repository variables NUGET_USERNAME/NUGET_PASSWORD for shared runners $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' if ($env:CI_JOB_TOKEN) { Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using CI_JOB_TOKEN...' try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text + } elseif ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { + Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using NUGET_USERNAME/NUGET_PASSWORD...' + try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text } else { - Write-Host 'CI_JOB_TOKEN not available; skipping private NuGet source configuration.' + Write-Host 'No credentials available; skipping private NuGet source configuration.' } # Find first file in publish folder From f4893a39e959f9b43ba1ef3fda45017cb76768cb Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Tue, 17 Feb 2026 20:51:35 +0100 Subject: [PATCH 09/69] Improve multi-line text, logo, and version display - Enhance ImageCreatorAlternate to support multi-line text rendering with correct sizing, spacing, and shadow for each line. - Only draw logos on non-thumbnail images to match GDI behavior. - Add a status bar to MainWindow showing the app version at runtime. - Upgrade MinVer to 7.0.0 and adjust versioning to avoid WPF/XAML assembly identity issues. - Refactor XAML layout to accommodate the new status bar. --- MaddoShared/ImageCreatorAlternate.cs | 33 +++++++++++++++++++++------- imagecatalog/ImageCatalog 2.csproj | 20 ++++++----------- imagecatalog/MainWindow.xaml | 18 +++++++++++++-- imagecatalog/MainWindow.xaml.cs | 22 +++++++++++++++++++ 4 files changed, 70 insertions(+), 23 deletions(-) diff --git a/MaddoShared/ImageCreatorAlternate.cs b/MaddoShared/ImageCreatorAlternate.cs index 8ddfbec..80f42d3 100644 --- a/MaddoShared/ImageCreatorAlternate.cs +++ b/MaddoShared/ImageCreatorAlternate.cs @@ -171,15 +171,22 @@ public class ImageCreatorAlternate : IImageCreator var maxTextWidth = working.Width * 0.95f; var maxTextHeight = working.Height * 0.15f; - var chosenSize = FindBestFontSize(text, font.Name, Math.Max(6, baseSize), maxTextWidth, maxTextHeight); + // Support multi-line text: measure using the longest line when choosing font size + var normalizedText = text.Replace("\r", string.Empty); + var lines = normalizedText.Split(new[] { '\n' }, StringSplitOptions.None); + var longestLine = lines.OrderByDescending(l => l.Length).FirstOrDefault() ?? string.Empty; + + var chosenSize = FindBestFontSize(longestLine, font.Name, Math.Max(6, baseSize), maxTextWidth, maxTextHeight); // Use final font var finalFont = SixLabors.Fonts.SystemFonts.CreateFont(font.Name, chosenSize); if (!isThumbnail) imgState.DimensioneStandard = (int)Math.Round(chosenSize); // Approximate measured size since TextMeasurer/RendererOptions may not be available in this Fonts version - var approxWidth = finalFont.Size * text.Length * 0.6f; - var approxHeight = finalFont.Size * 1.0f; + var approxWidth = finalFont.Size * longestLine.Length * 0.6f; + // Account for multiple lines: height = font size * lineCount * lineSpacing + var lineSpacing = 1.1f; // small extra spacing between lines + var approxHeight = finalFont.Size * lines.Length * lineSpacing; // Compute horizontal position based on alignment float xCenterOfImg; @@ -228,16 +235,26 @@ public class ImageCreatorAlternate : IImageCreator originX = Math.Max(0, Math.Min(originX, working.Width - approxWidth)); originY = Math.Max(0, Math.Min(originY, working.Height - approxHeight)); - // Draw shadow then text + // Draw shadow then text; handle multiple lines + var lineHeight = finalFont.Size * lineSpacing; working.Mutate(ctx => { - ctx.DrawText(text, finalFont, shadowColor, new SixLabors.ImageSharp.PointF(originX + 1, originY + 1)); - ctx.DrawText(text, finalFont, textColor, new SixLabors.ImageSharp.PointF(originX, originY)); + for (int i = 0; i < lines.Length; i++) + { + var line = lines[i]; + var y = originY + i * lineHeight; + // Ensure we're drawing inside the canvas vertically + if (y + finalFont.Size < 0 || y > working.Height) continue; + + ctx.DrawText(line, finalFont, shadowColor, new SixLabors.ImageSharp.PointF(originX + 1, y + 1)); + ctx.DrawText(line, finalFont, textColor, new SixLabors.ImageSharp.PointF(originX, y)); + } }); } - // Draw logo if provided - if (logo != null && _picSettings.LogoAggiungi) + // Draw logo if provided. For compatibility with the original GDI implementation, + // do not draw the logo on thumbnails (ImageCreatorSharp only draws logos on big images). + if (logo != null && _picSettings.LogoAggiungi && !isThumbnail) { try { diff --git a/imagecatalog/ImageCatalog 2.csproj b/imagecatalog/ImageCatalog 2.csproj index 3744a5c..b6b77b9 100644 --- a/imagecatalog/ImageCatalog 2.csproj +++ b/imagecatalog/ImageCatalog 2.csproj @@ -7,10 +7,6 @@ true true False - 3.1.2.0 - 3.1.2.0 - 3.1.2 - 3.1.2 ImageCatalog default @@ -20,6 +16,9 @@ win-x64 + true @@ -46,20 +45,15 @@ - + all - - - - $(Version) - $(Version) - $(Version) - + True diff --git a/imagecatalog/MainWindow.xaml b/imagecatalog/MainWindow.xaml index 17bda4f..7e23dae 100644 --- a/imagecatalog/MainWindow.xaml +++ b/imagecatalog/MainWindow.xaml @@ -31,8 +31,14 @@ - - + + + + + + + + @@ -318,5 +324,13 @@ + + + + + + + + \ No newline at end of file diff --git a/imagecatalog/MainWindow.xaml.cs b/imagecatalog/MainWindow.xaml.cs index b7cb1be..5d07dd9 100644 --- a/imagecatalog/MainWindow.xaml.cs +++ b/imagecatalog/MainWindow.xaml.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.DependencyInjection; using System; using System.IO; using System.Windows.Media.Imaging; +using System.Diagnostics; using Microsoft.Win32; using System.Windows.Forms; @@ -16,6 +17,27 @@ namespace ImageCatalog_2 InitializeComponent(); _model = model; DataContext = _model; + // Set product version in status bar (use ProductVersion rather than AssemblyVersion) + try + { + var entry = System.Reflection.Assembly.GetEntryAssembly(); + string version = string.Empty; + if (entry is not null && !string.IsNullOrEmpty(entry.Location)) + { + try + { + version = FileVersionInfo.GetVersionInfo(entry.Location).ProductVersion ?? string.Empty; + } + catch { } + } + if (string.IsNullOrWhiteSpace(version)) + { + // fallback to assembly version + version = entry?.GetName().Version?.ToString() ?? string.Empty; + } + VersionTextBlock.Text = string.IsNullOrWhiteSpace(version) ? string.Empty : $"v{version}"; + } + catch { } // Apply theme based on user preference or system setting (default to light) ApplyTheme(isDark: false); // Subscribe to DataModel events that require UI dialogs From bbda970d57331f887625304b8476334aba784aeb Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 14:12:15 +0100 Subject: [PATCH 10/69] Remove EXIF orientation tag after image processing Ensures EXIF orientation is cleared when cloning and after rotation, preventing incorrect display in EXIF-aware viewers. Failures are logged as debug messages without interrupting processing. --- MaddoShared/ImageCreatorAlternate.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/MaddoShared/ImageCreatorAlternate.cs b/MaddoShared/ImageCreatorAlternate.cs index 80f42d3..ddb9690 100644 --- a/MaddoShared/ImageCreatorAlternate.cs +++ b/MaddoShared/ImageCreatorAlternate.cs @@ -113,6 +113,18 @@ public class ImageCreatorAlternate : IImageCreator // Clone editable image so we don't mutate the original reference unexpectedly. using var working = imgSharp.Clone(); + // Ensure the EXIF orientation tag is not present on the working image so + // the final saved file has correct upright pixels and won't be + // re-oriented by EXIF-aware viewers. + try + { + working.Metadata?.ExifProfile?.RemoveValue(ExifTag.Orientation); + } + catch (Exception ex) + { + _logger?.LogDebug(ex, "[Alternate] Failed to clear EXIF orientation on working image"); + } + // Ensure DataFoto is set (extracted earlier) so time-based text is available imgState.DataFoto = imgState.CreationDate ?? DateTime.Now; @@ -500,6 +512,19 @@ public class ImageCreatorAlternate : IImageCreator default: break; } + + // After applying the pixel rotation, remove the EXIF orientation tag so + // viewers do not re-apply the rotation. Leaving the tag causes some + // viewers to display the image in the wrong (original) orientation. + try + { + img.Metadata?.ExifProfile?.RemoveValue(ExifTag.Orientation); + } + catch (Exception ex) + { + // Non-fatal: log and continue + _logger?.LogDebug(ex, "[Alternate] Could not clear EXIF orientation tag"); + } } private System.Drawing.Size ComputeBigSize(int width, int height) From 7e1ca95a25986d59fa9a8d6eeedfd136a4384310 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 15:43:26 +0100 Subject: [PATCH 11/69] Improve text overlay for rotated and multi-line images - Use vertical text variant (TestoFirmaV) for rotated images to ensure correct orientation of overlays. - Adjust font sizing logic for multi-line text to better fit within image bounds, accounting for line count and spacing. - Set rotation flags (FotoRuotaADestra, FotoRuotaASinistra) before drawing text, enabling correct text variant selection. - Ensure vertical text field is initialized from settings for consistent behavior. --- MaddoShared/ImageCreatorAlternate.cs | 48 +++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/MaddoShared/ImageCreatorAlternate.cs b/MaddoShared/ImageCreatorAlternate.cs index ddb9690..ecbe6ac 100644 --- a/MaddoShared/ImageCreatorAlternate.cs +++ b/MaddoShared/ImageCreatorAlternate.cs @@ -54,6 +54,9 @@ public class ImageCreatorAlternate : IImageCreator ExtractExif(img, imgState); // Apply orientation + // Set rotation flags and apply orientation so downstream logic can + // use imgState.FotoRuotaADestra / FotoRuotaASinistra to decide which + // text to draw (horizontal vs vertical). ApplyExifOrientation(img, imgState); // Determine output format @@ -144,8 +147,11 @@ public class ImageCreatorAlternate : IImageCreator } } - // Prepare text - var text = isThumbnail ? imgState.TestoFirmaPiccola : imgState.TestoFirma; + // Prepare text. For rotated (vertical) photos prefer the vertical text + // variant coming from the viewmodel/settings (TestoFirmaStartV). + var text = isThumbnail + ? imgState.TestoFirmaPiccola + : ((imgState.FotoRuotaADestra || imgState.FotoRuotaASinistra) ? imgState.TestoFirmaV : imgState.TestoFirma); if (string.IsNullOrEmpty(text) && _picSettings.TestoNome) text = imgState.NomeFileBig; @@ -179,6 +185,7 @@ public class ImageCreatorAlternate : IImageCreator } var shadowColor = SixLabors.ImageSharp.Color.FromRgba(0, 0, 0, (byte)imgState.AlphaScelta); + // Find best font size so text fits image width (allow 95% width) and not exceed ~15% height var maxTextWidth = working.Width * 0.95f; var maxTextHeight = working.Height * 0.15f; @@ -188,7 +195,14 @@ public class ImageCreatorAlternate : IImageCreator var lines = normalizedText.Split(new[] { '\n' }, StringSplitOptions.None); var longestLine = lines.OrderByDescending(l => l.Length).FirstOrDefault() ?? string.Empty; - var chosenSize = FindBestFontSize(longestLine, font.Name, Math.Max(6, baseSize), maxTextWidth, maxTextHeight); + // Use a line spacing factor when computing allowed font size so multi-line + // text is sized to fit vertically. The existing FindBestFontSize helper + // approximates single-line height; to account for multiple lines pass a + // reduced maxHeight to that helper. + var lineSpacing = 1.1f; // small extra spacing between lines + var adjustedMaxHeight = Math.Max(6f, maxTextHeight / (lines.Length * lineSpacing)); + + var chosenSize = FindBestFontSize(longestLine, font.Name, Math.Max(6, baseSize), maxTextWidth, adjustedMaxHeight); // Use final font var finalFont = SixLabors.Fonts.SystemFonts.CreateFont(font.Name, chosenSize); @@ -197,7 +211,6 @@ public class ImageCreatorAlternate : IImageCreator // Approximate measured size since TextMeasurer/RendererOptions may not be available in this Fonts version var approxWidth = finalFont.Size * longestLine.Length * 0.6f; // Account for multiple lines: height = font size * lineCount * lineSpacing - var lineSpacing = 1.1f; // small extra spacing between lines var approxHeight = finalFont.Size * lines.Length * lineSpacing; // Compute horizontal position based on alignment @@ -442,6 +455,9 @@ public class ImageCreatorAlternate : IImageCreator // Set minimal text fields so text drawing has fallback values imgState.TestoFirma ??= _picSettings.TestoFirmaStart ?? string.Empty; + // Ensure vertical text is populated from settings so callers can + // select the proper variant when drawing vertical photos. + imgState.TestoFirmaV ??= _picSettings.TestoFirmaStartV ?? string.Empty; imgState.TestoFirmaPiccola ??= string.Empty; imgState.DataPartenzaI = _picSettings.DataPartenza; imgState.TestoOrario = _picSettings.TestoOrario ?? string.Empty; @@ -498,6 +514,30 @@ public class ImageCreatorAlternate : IImageCreator private void ApplyExifOrientation(Image img, ImageState imgState) { // Common EXIF orientations: 1=TopLeft, 3=BottomRight (rotate 180), 6=RightTop (rotate 90 CW), 8=LeftBottom (rotate 270 CW) + // Set rotation flags on the state so other code can pick the correct + // text variant (vertical vs horizontal). Mirror ImageCreatorSharp logic. + imgState.FotoRuotaADestra = false; + imgState.FotoRuotaASinistra = false; + + if (_picSettings.UsaRotazioneAutomatica) + { + switch (imgState.Orientation) + { + case Orientations.BottomLeft: + case Orientations.BottomRight: + case Orientations.LeftTop: + case Orientations.LftBottom: + imgState.FotoRuotaASinistra = true; + break; + case Orientations.RightBottom: + case Orientations.RightTop: + case Orientations.TopLeft: + case Orientations.TopRight: + // no-op + break; + } + } + switch (imgState.Orientation) { case Orientations.RightTop: // 6 From 4091fb78c5559b856aa7d4140051aad388caf8c0 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 15:46:03 +0100 Subject: [PATCH 12/69] Center each text line individually when drawing on image Updated text rendering logic to center each line horizontally based on its estimated width, ensuring multi-line text is visually centered. Previously, all lines were drawn at a fixed horizontal position. Both shadow and main text now use the calculated centered position. --- MaddoShared/ImageCreatorAlternate.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/MaddoShared/ImageCreatorAlternate.cs b/MaddoShared/ImageCreatorAlternate.cs index ecbe6ac..476b9be 100644 --- a/MaddoShared/ImageCreatorAlternate.cs +++ b/MaddoShared/ImageCreatorAlternate.cs @@ -271,8 +271,16 @@ public class ImageCreatorAlternate : IImageCreator // Ensure we're drawing inside the canvas vertically if (y + finalFont.Size < 0 || y > working.Height) continue; - ctx.DrawText(line, finalFont, shadowColor, new SixLabors.ImageSharp.PointF(originX + 1, y + 1)); - ctx.DrawText(line, finalFont, textColor, new SixLabors.ImageSharp.PointF(originX, y)); + // Center each line individually so multi-line (vertical) text is justified to center + var approxWidthLine = finalFont.Size * (line?.Length ?? 0) * 0.6f; + if (approxWidthLine > working.Width) + approxWidthLine = working.Width * 0.95f; + + var x = xCenterOfImg - (approxWidthLine / 2f); + x = Math.Max(0, Math.Min(x, working.Width - approxWidthLine)); + + ctx.DrawText(line, finalFont, shadowColor, new SixLabors.ImageSharp.PointF(x + 1, y + 1)); + ctx.DrawText(line, finalFont, textColor, new SixLabors.ImageSharp.PointF(x, y)); } }); } From c70ab9e5de825e4602c0df7ca5f292de0152b780 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 15:53:52 +0100 Subject: [PATCH 13/69] Renamed image creators --- MaddoShared.Benchmarks/ChunkSizeBenchmarks.cs | 12 +++++------ .../ImageProcessingBenchmarks.cs | 20 +++++++++---------- MaddoShared.Benchmarks/ImageSizeBenchmarks.cs | 12 +++++------ MaddoShared.Benchmarks/StressTestBenchmark.cs | 14 ++++++------- MaddoShared.Tests/ImageCreatorSharpTests.cs | 6 +++--- MaddoShared/ImageCreationStuff.cs | 4 ++-- MaddoShared/ImageCreatorAlternate.cs | 6 +++--- MaddoShared/ImageCreatorMapper.cs | 8 ++++---- MaddoShared/ImageCreatorSharp.cs | 2 +- imagecatalog/DataModel.cs | 6 +++--- imagecatalog/MainForm.cs | 2 +- imagecatalog/Program.cs | 8 ++++---- 12 files changed, 50 insertions(+), 50 deletions(-) diff --git a/MaddoShared.Benchmarks/ChunkSizeBenchmarks.cs b/MaddoShared.Benchmarks/ChunkSizeBenchmarks.cs index 8ea126f..710b5e6 100644 --- a/MaddoShared.Benchmarks/ChunkSizeBenchmarks.cs +++ b/MaddoShared.Benchmarks/ChunkSizeBenchmarks.cs @@ -22,7 +22,7 @@ public class ChunkSizeBenchmarks { private string _sourceDirectory; private string _destinationDirectory; - private ImageCreationStuff _imageCreationStuff; + private ImageCreationService _imageCreationStuff; private PicSettings _picSettings; [Params(100)] @@ -49,8 +49,8 @@ public class ChunkSizeBenchmarks builder.SetMinimumLevel(LogLevel.Warning); }); - var logger = loggerFactory.CreateLogger(); - var imageCreatorLogger = loggerFactory.CreateLogger(); + var logger = loggerFactory.CreateLogger(); + var imageCreatorLogger = loggerFactory.CreateLogger(); _picSettings = new PicSettings { @@ -75,8 +75,8 @@ public class ChunkSizeBenchmarks Trasparenza = 100 }; - var imageCreatorService = new ImageCreatorSharp(_picSettings, imageCreatorLogger); - _imageCreationStuff = new ImageCreationStuff(logger, _picSettings, imageCreatorService); + var imageCreatorService = new ImageCreatorGDI(_picSettings, imageCreatorLogger); + _imageCreationStuff = new ImageCreationService(logger, _picSettings, imageCreatorService); } [GlobalCleanup] @@ -109,7 +109,7 @@ public class ChunkSizeBenchmarks [Benchmark] public async Task ProcessWithVariableChunkSize() { - var options = new ImageCreationStuff.Options + var options = new ImageCreationService.Options { SourcePath = _sourceDirectory, DestinationPath = _destinationDirectory, diff --git a/MaddoShared.Benchmarks/ImageProcessingBenchmarks.cs b/MaddoShared.Benchmarks/ImageProcessingBenchmarks.cs index 0ed6069..572c436 100644 --- a/MaddoShared.Benchmarks/ImageProcessingBenchmarks.cs +++ b/MaddoShared.Benchmarks/ImageProcessingBenchmarks.cs @@ -22,10 +22,10 @@ public class ImageProcessingBenchmarks { private string _sourceDirectory; private string _destinationDirectory; - private ImageCreationStuff _imageCreationStuff; + private ImageCreationService _imageCreationStuff; private PicSettings _picSettings; - private ILogger _logger; - private ILogger _imageCreatorLogger; + private ILogger _logger; + private ILogger _imageCreatorLogger; [Params(10, 50, 100)] public int ImageCount { get; set; } @@ -54,8 +54,8 @@ public class ImageProcessingBenchmarks builder.SetMinimumLevel(LogLevel.Warning); // Reduce noise during benchmarks }); - _logger = loggerFactory.CreateLogger(); - _imageCreatorLogger = loggerFactory.CreateLogger(); + _logger = loggerFactory.CreateLogger(); + _imageCreatorLogger = loggerFactory.CreateLogger(); // Setup PicSettings with default values _picSettings = new PicSettings @@ -81,8 +81,8 @@ public class ImageProcessingBenchmarks Trasparenza = 100 }; - var imageCreatorService = new ImageCreatorSharp(_picSettings, _imageCreatorLogger); - _imageCreationStuff = new ImageCreationStuff(_logger, _picSettings, imageCreatorService); + var imageCreatorService = new ImageCreatorGDI(_picSettings, _imageCreatorLogger); + _imageCreationStuff = new ImageCreationService(_logger, _picSettings, imageCreatorService); } [GlobalCleanup] @@ -117,7 +117,7 @@ public class ImageProcessingBenchmarks [Benchmark(Description = "Process images in parallel with chunking")] public async Task ProcessImagesParallelWithChunks() { - var options = new ImageCreationStuff.Options + var options = new ImageCreationService.Options { SourcePath = _sourceDirectory, DestinationPath = _destinationDirectory, @@ -139,7 +139,7 @@ public class ImageProcessingBenchmarks [Benchmark(Description = "Process images in parallel without chunking")] public async Task ProcessImagesParallelWithoutChunks() { - var options = new ImageCreationStuff.Options + var options = new ImageCreationService.Options { SourcePath = _sourceDirectory, DestinationPath = _destinationDirectory, @@ -161,7 +161,7 @@ public class ImageProcessingBenchmarks [Benchmark(Description = "Process images linearly")] public async Task ProcessImagesLinear() { - var options = new ImageCreationStuff.Options + var options = new ImageCreationService.Options { SourcePath = _sourceDirectory, DestinationPath = _destinationDirectory, diff --git a/MaddoShared.Benchmarks/ImageSizeBenchmarks.cs b/MaddoShared.Benchmarks/ImageSizeBenchmarks.cs index fe42fcc..4d71e9f 100644 --- a/MaddoShared.Benchmarks/ImageSizeBenchmarks.cs +++ b/MaddoShared.Benchmarks/ImageSizeBenchmarks.cs @@ -22,7 +22,7 @@ public class ImageSizeBenchmarks { private string _sourceDirectory; private string _destinationDirectory; - private ImageCreationStuff _imageCreationStuff; + private ImageCreationService _imageCreationStuff; private PicSettings _picSettings; [Params(50)] @@ -58,8 +58,8 @@ public class ImageSizeBenchmarks builder.SetMinimumLevel(LogLevel.Warning); }); - var logger = loggerFactory.CreateLogger(); - var imageCreatorLogger = loggerFactory.CreateLogger(); + var logger = loggerFactory.CreateLogger(); + var imageCreatorLogger = loggerFactory.CreateLogger(); _picSettings = new PicSettings { @@ -84,8 +84,8 @@ public class ImageSizeBenchmarks Trasparenza = 100 }; - var imageCreatorService = new ImageCreatorSharp(_picSettings, imageCreatorLogger); - _imageCreationStuff = new ImageCreationStuff(logger, _picSettings, imageCreatorService); + var imageCreatorService = new ImageCreatorGDI(_picSettings, imageCreatorLogger); + _imageCreationStuff = new ImageCreationService(logger, _picSettings, imageCreatorService); } private static (int width, int height) GetDimensions(ImageSize size) @@ -130,7 +130,7 @@ public class ImageSizeBenchmarks [Benchmark] public async Task ProcessDifferentImageSizes() { - var options = new ImageCreationStuff.Options + var options = new ImageCreationService.Options { SourcePath = _sourceDirectory, DestinationPath = _destinationDirectory, diff --git a/MaddoShared.Benchmarks/StressTestBenchmark.cs b/MaddoShared.Benchmarks/StressTestBenchmark.cs index 4d626ae..207b434 100644 --- a/MaddoShared.Benchmarks/StressTestBenchmark.cs +++ b/MaddoShared.Benchmarks/StressTestBenchmark.cs @@ -22,7 +22,7 @@ public class StressTestBenchmark { private string _sourceDirectory; private string _destinationDirectory; - private ImageCreationStuff _imageCreationStuff; + private ImageCreationService _imageCreationStuff; private PicSettings _picSettings; [Params(500, 1000)] @@ -49,8 +49,8 @@ public class StressTestBenchmark builder.SetMinimumLevel(LogLevel.Warning); }); - var logger = loggerFactory.CreateLogger(); - var imageCreatorLogger = loggerFactory.CreateLogger(); + var logger = loggerFactory.CreateLogger(); + var imageCreatorLogger = loggerFactory.CreateLogger(); _picSettings = new PicSettings { @@ -75,8 +75,8 @@ public class StressTestBenchmark Trasparenza = 100 }; - var imageCreatorService = new ImageCreatorSharp(_picSettings, imageCreatorLogger); - _imageCreationStuff = new ImageCreationStuff(logger, _picSettings, imageCreatorService); + var imageCreatorService = new ImageCreatorGDI(_picSettings, imageCreatorLogger); + _imageCreationStuff = new ImageCreationService(logger, _picSettings, imageCreatorService); Console.WriteLine($"[STRESS TEST] Setup complete. Ready to process {ImageCount} images."); } @@ -113,7 +113,7 @@ public class StressTestBenchmark [Benchmark(Description = "Stress test with optimal settings")] public async Task StressTestOptimalSettings() { - var options = new ImageCreationStuff.Options + var options = new ImageCreationService.Options { SourcePath = _sourceDirectory, DestinationPath = _destinationDirectory, @@ -143,7 +143,7 @@ public class StressTestBenchmark [Benchmark(Description = "Stress test with aggressive memory management")] public async Task StressTestAggressiveMemoryManagement() { - var options = new ImageCreationStuff.Options + var options = new ImageCreationService.Options { SourcePath = _sourceDirectory, DestinationPath = _destinationDirectory, diff --git a/MaddoShared.Tests/ImageCreatorSharpTests.cs b/MaddoShared.Tests/ImageCreatorSharpTests.cs index d053452..8d0dc91 100644 --- a/MaddoShared.Tests/ImageCreatorSharpTests.cs +++ b/MaddoShared.Tests/ImageCreatorSharpTests.cs @@ -14,7 +14,7 @@ namespace MaddoShared.Tests [TestClass] public class ImageCreatorSharpTests { - private ImageCreatorSharp CreateService(Action customize = null) + private ImageCreatorGDI CreateService(Action customize = null) { var settings = new PicSettings { @@ -37,8 +37,8 @@ namespace MaddoShared.Tests customize?.Invoke(settings); - var logger = new Mock>().Object; - return new ImageCreatorSharp(settings, logger); + var logger = new Mock>().Object; + return new ImageCreatorGDI(settings, logger); } [TestMethod] diff --git a/MaddoShared/ImageCreationStuff.cs b/MaddoShared/ImageCreationStuff.cs index b688f3a..470e1d6 100644 --- a/MaddoShared/ImageCreationStuff.cs +++ b/MaddoShared/ImageCreationStuff.cs @@ -15,8 +15,8 @@ using Microsoft.Extensions.Logging; namespace MaddoShared { [SuppressMessage("Interoperability", "CA1416:Validate platform compatibility")] - public class ImageCreationStuff( - ILogger logger, + public class ImageCreationService( + ILogger logger, PicSettings picSettings, IImageCreator imageCreatorService) { diff --git a/MaddoShared/ImageCreatorAlternate.cs b/MaddoShared/ImageCreatorAlternate.cs index 476b9be..d5af0f3 100644 --- a/MaddoShared/ImageCreatorAlternate.cs +++ b/MaddoShared/ImageCreatorAlternate.cs @@ -23,12 +23,12 @@ namespace MaddoShared; /// provide a safe and testable replacement. Additional features (text/logo drawing) /// can be added later using ImageSharp.Drawing.Common and SixLabors.Fonts. /// -public class ImageCreatorAlternate : IImageCreator +public class ImageCreatorImageSharp : IImageCreator { private readonly PicSettings _picSettings; - private readonly ILogger _logger; + private readonly ILogger _logger; - public ImageCreatorAlternate(PicSettings picSettings, ILogger logger) + public ImageCreatorImageSharp(PicSettings picSettings, ILogger logger) { _picSettings = picSettings ?? throw new ArgumentNullException(nameof(picSettings)); _logger = logger; diff --git a/MaddoShared/ImageCreatorMapper.cs b/MaddoShared/ImageCreatorMapper.cs index 8ee07cf..32ee6ac 100644 --- a/MaddoShared/ImageCreatorMapper.cs +++ b/MaddoShared/ImageCreatorMapper.cs @@ -27,8 +27,8 @@ public class ImageCreatorMapper : IImageCreator _logger?.LogDebug("Resolving IImageCreator for provider '{Provider}'", provider); return provider.Equals("ALTERNATE", StringComparison.OrdinalIgnoreCase) - ? ResolveAndCall(imgState, logo) - : ResolveAndCall(imgState, logo); + ? ResolveAndCall(imgState, logo) + : ResolveAndCall(imgState, logo); } private Task ResolveAndCall(ImageState imgState, System.Drawing.Image logo) where T : IImageCreator @@ -37,8 +37,8 @@ public class ImageCreatorMapper : IImageCreator var impl = (IImageCreator)_sp.GetService(typeof(T)); if (impl is null) { - _logger?.LogWarning("Requested image creator {Type} is not registered. Falling back to ImageCreatorSharp.", typeof(T).Name); - impl = (IImageCreator)_sp.GetService(typeof(ImageCreatorSharp)); + _logger?.LogWarning("Requested image creator {Type} is not registered. Falling back to ImageCreatorGDI.", typeof(T).Name); + impl = (IImageCreator)_sp.GetService(typeof(ImageCreatorGDI)); } if (impl is null) diff --git a/MaddoShared/ImageCreatorSharp.cs b/MaddoShared/ImageCreatorSharp.cs index b430a36..fdac999 100644 --- a/MaddoShared/ImageCreatorSharp.cs +++ b/MaddoShared/ImageCreatorSharp.cs @@ -15,7 +15,7 @@ using SixLabors.ImageSharp.Metadata.Profiles.Exif; namespace MaddoShared; [SuppressMessage("Interoperability", "CA1416:Validate platform compatibility")] -public class ImageCreatorSharp(PicSettings picSettings, ILogger logger) : IImageCreator +public class ImageCreatorGDI(PicSettings picSettings, ILogger logger) : IImageCreator { public async Task CreateImageAsync(ImageState imgState, Image logo) { diff --git a/imagecatalog/DataModel.cs b/imagecatalog/DataModel.cs index cafff8c..fbb0223 100644 --- a/imagecatalog/DataModel.cs +++ b/imagecatalog/DataModel.cs @@ -37,7 +37,7 @@ namespace ImageCatalog_2 private readonly ITestService _service; private readonly ILogger _logger; private readonly ISettingsService _settingsService; - private readonly ImageCreationStuff _imageCreationService; + private readonly ImageCreationService _imageCreationService; private readonly PicSettings _picSettings; private readonly IMapper _mapper; @@ -47,7 +47,7 @@ namespace ImageCatalog_2 public List HorizontalAlignments { get; } = new() { "Sinistra", "Centro", "Destra" }; public DataModel(ITestService testService, ISettingsService settingsService, - ImageCreationStuff imageCreationService, PicSettings picSettings, + ImageCreationService imageCreationService, PicSettings picSettings, IMapper mapper, ILogger logger, MaddoShared.IVersionProvider? versionProvider = null) { _service = testService; @@ -1273,7 +1273,7 @@ namespace ImageCatalog_2 // Best-effort; do not fail processing on mapping issues } - var imageCreationOptions = new ImageCreationStuff.Options + var imageCreationOptions = new ImageCreationService.Options { AggiornaSottodirectory = UpdateSubdirectories, CreaSottocartelle = CreateSubfolders, diff --git a/imagecatalog/MainForm.cs b/imagecatalog/MainForm.cs index e951bc3..86586d0 100644 --- a/imagecatalog/MainForm.cs +++ b/imagecatalog/MainForm.cs @@ -33,7 +33,7 @@ public partial class MainForm private bool _suppressRadioUpdates = false; private bool _transparentDialogOpen = false; - public MainForm(DataModel model, ImageCreationStuff imageCreationStuff, PicSettings picSettings, + public MainForm(DataModel model, ImageCreationService imageCreationStuff, PicSettings picSettings, ParametriSetup parametriSetup, ILogger logger) { Model = model; diff --git a/imagecatalog/Program.cs b/imagecatalog/Program.cs index 55b12c5..65e51a0 100644 --- a/imagecatalog/Program.cs +++ b/imagecatalog/Program.cs @@ -113,7 +113,7 @@ static class Program // Resolve optional version provider and pass to DataModel var testService = sp.GetRequiredService(); var settingsService = sp.GetRequiredService(); - var imageCreation = sp.GetRequiredService(); + var imageCreation = sp.GetRequiredService(); var picSettings = sp.GetRequiredService(); var mapper = sp.GetRequiredService(); var logger = sp.GetRequiredService>(); @@ -122,9 +122,9 @@ static class Program return new DataModel(testService, settingsService, imageCreation, picSettings, mapper, logger, versionProvider); }); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); // Register IImageCreator to be resolved via ImageCreatorMapper which selects concrete implementation at call time From ec4635a37f2b72ea53cfd7ac2717bdc5c83ec9ce Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 16:04:58 +0100 Subject: [PATCH 14/69] Add Material icons to UI and refactor theme resources Integrated MahApps.Metro.IconPacks for Material icons in tab headers and buttons, enhancing visual clarity and user experience. Refactored resource dictionary to define theme brushes at the top level for easier theme switching. All button content now combines icons and text for a more modern interface. No functional changes; UI/UX improvements only. --- imagecatalog/ImageCatalog 2.csproj | 1 + imagecatalog/MainWindow.xaml | 187 +++++++++++++++++++++++------ 2 files changed, 152 insertions(+), 36 deletions(-) diff --git a/imagecatalog/ImageCatalog 2.csproj b/imagecatalog/ImageCatalog 2.csproj index b6b77b9..e4573cc 100644 --- a/imagecatalog/ImageCatalog 2.csproj +++ b/imagecatalog/ImageCatalog 2.csproj @@ -45,6 +45,7 @@ + all diff --git a/imagecatalog/MainWindow.xaml b/imagecatalog/MainWindow.xaml index 7e23dae..d8fec54 100644 --- a/imagecatalog/MainWindow.xaml +++ b/imagecatalog/MainWindow.xaml @@ -3,31 +3,40 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" mc:Ignorable="d" Title="Image Catalog - WPF" Height="490" Width="800" Background="{DynamicResource WindowBackgroundBrush}" Foreground="{DynamicResource ControlForegroundBrush}"> - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + @@ -46,7 +55,13 @@ - + + + + + + + @@ -61,8 +76,18 @@ - + @@ -75,8 +100,18 @@ - + @@ -122,7 +157,13 @@ - + + + + + + + @@ -142,7 +183,12 @@ @@ -162,7 +208,13 @@ - + + + + + + + @@ -190,7 +242,13 @@ - + + + + + + + @@ -219,12 +277,23 @@ - + + + + + + + - @@ -250,7 +319,13 @@ - + + + + + + + @@ -266,8 +341,18 @@ - + @@ -280,8 +365,18 @@ - + @@ -301,10 +396,30 @@ - + + + From 9007a27fb256b865331c99badfa73f6f71570c24 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 16:49:13 +0100 Subject: [PATCH 15/69] Upgrade UI to MahApps.Metro with runtime theming Modernize WPF UI using MahApps.Metro: switch MainWindow to MetroWindow, add MetroTabControl/MetroTabItem, custom tab styles, and icon-based theme toggle. Move version display to window commands. Integrate MahApps resource dictionaries and ThemeManager for runtime theme switching. Update startup logic for proper theming. WinForms fallback retained. --- imagecatalog/ImageCatalog 2.csproj | 1 + imagecatalog/MainWindow.xaml | 134 ++++++++++++++++++++--------- imagecatalog/MainWindow.xaml.cs | 83 +++++++++++++++++- imagecatalog/Program.cs | 43 +++++++-- 4 files changed, 207 insertions(+), 54 deletions(-) diff --git a/imagecatalog/ImageCatalog 2.csproj b/imagecatalog/ImageCatalog 2.csproj index e4573cc..cbd865d 100644 --- a/imagecatalog/ImageCatalog 2.csproj +++ b/imagecatalog/ImageCatalog 2.csproj @@ -42,6 +42,7 @@ + diff --git a/imagecatalog/MainWindow.xaml b/imagecatalog/MainWindow.xaml index d8fec54..b423b4c 100644 --- a/imagecatalog/MainWindow.xaml +++ b/imagecatalog/MainWindow.xaml @@ -1,15 +1,18 @@ - - + Title="Image Catalog - WPF" Height="540" Width="800" + Background="{DynamicResource WindowBackgroundBrush}" Foreground="{DynamicResource ControlForegroundBrush}" + GlowBrush="{DynamicResource AccentBrush}"> + + @@ -38,8 +41,49 @@ + + + - + + + + + + + + @@ -54,14 +98,14 @@ - - - + + + - + @@ -155,15 +199,15 @@ - + - - + + - + @@ -206,15 +250,15 @@ - + - - + + - + @@ -240,15 +284,15 @@ - + - - + + - + @@ -275,15 +319,15 @@ - + - - + + - + @@ -317,15 +361,15 @@ - + - - + + - + @@ -388,14 +432,22 @@ - - + + - - - - + + + + + + + + + + + + @@ -248,6 +243,17 @@ + + + + + + + + + + + @@ -271,8 +277,6 @@ - - @@ -296,6 +300,7 @@ + @@ -353,6 +358,12 @@ + From d068b4b3e183d1fa38bddd611b0a28195d4da600 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 17:27:16 +0100 Subject: [PATCH 17/69] Support UI selection via --wpf command-line argument Refactored Program.cs to accept command-line arguments and select between WinForms (default) and WPF UI based on the presence of --wpf. Removed old commented-out UI selection code. Updated launchSettings.json to provide separate profiles for WinForms and WPF launches. If WPF is requested but unavailable, the app falls back to WinForms. --- imagecatalog/Program.cs | 40 ++++++++++----------- imagecatalog/Properties/launchSettings.json | 11 ++++-- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/imagecatalog/Program.cs b/imagecatalog/Program.cs index b32c760..ba559a4 100644 --- a/imagecatalog/Program.cs +++ b/imagecatalog/Program.cs @@ -57,7 +57,7 @@ static class Program public static IServiceProvider ServiceProvider { get; private set; } [STAThread] - static void Main() + static void Main(string[] args) { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); @@ -74,21 +74,14 @@ static class Program // Resolve WPF MainWindow when available, otherwise fall back to WinForms MainForm var serviceProvider = ServiceProvider; - // NOTE: By default the app will attempt to run the WPF window when available and fall back - // to the WinForms MainForm. If you want to force the WinForms UI for testing, uncomment - // the block below and comment out the WPF branch. - // ----------------------------------------------------------------------------- - // // Force WinForms UI (uncomment to enable) - //var mainForm = serviceProvider.GetRequiredService(); - //// If you want to set the DataModel explicitly on the WinForms form use the lines below - //// var mainViewModel = serviceProvider.GetRequiredService(); - //// mainForm.Model = mainViewModel; - //Application.Run(mainForm); - // ----------------------------------------------------------------------------- + // Determine UI based on command line. Default: WinForms. Use --wpf to explicitly request WPF. + bool useWpf = args is not null && Array.Exists(args, a => string.Equals(a, "--wpf", StringComparison.OrdinalIgnoreCase)); - // Create the WPF Application and merge MahApps resources BEFORE constructing the MainWindow - // so InitializeComponent sees the theme resources on first render. - var wpfApp = new System.Windows.Application(); + if (useWpf) + { + // Create the WPF Application and merge MahApps resources BEFORE constructing the MainWindow + // so InitializeComponent sees the theme resources on first render. + var wpfApp = new System.Windows.Application(); try { wpfApp.Resources.MergedDictionaries.Add(new System.Windows.ResourceDictionary { Source = new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml") }); @@ -111,15 +104,18 @@ static class Program // If resources fail to load (package not present at runtime), continue silently } - // Now resolve the WPF MainWindow so its constructor runs with the application resources available - var wpfMain = serviceProvider.GetService(typeof(ImageCatalog_2.MainWindow)) as ImageCatalog_2.MainWindow; - if (wpfMain is not null) - { - wpfApp.Run(wpfMain); - return; + // Now resolve the WPF MainWindow so its constructor runs with the application resources available + var wpfMain = serviceProvider.GetService(typeof(ImageCatalog_2.MainWindow)) as ImageCatalog_2.MainWindow; + if (wpfMain is not null) + { + wpfApp.Run(wpfMain); + return; + } + + // If WPF was requested but not available, fall back to WinForms. } - // Fallback to WinForms UI + // Default / fallback to WinForms UI var mainForm = serviceProvider.GetRequiredService(); System.Windows.Forms.Application.Run(mainForm); } diff --git a/imagecatalog/Properties/launchSettings.json b/imagecatalog/Properties/launchSettings.json index 641af8b..12da6a8 100644 --- a/imagecatalog/Properties/launchSettings.json +++ b/imagecatalog/Properties/launchSettings.json @@ -1,7 +1,12 @@ { "profiles": { - "Profile 1": { - "commandName": "Project" + "ImageCatalog (WinForms)": { + "commandName": "Project", + "commandLineArgs": "" + }, + "ImageCatalog (WPF)": { + "commandName": "Project", + "commandLineArgs": "--wpf" } } -} \ No newline at end of file +} From 900e8b6bf866f77cad8806d3df5260b3b6c15d4c Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 19:03:02 +0100 Subject: [PATCH 18/69] Update CI configuration and assembly information; remove log file and add logo image --- .gitlab-ci.yml | 12 ++- MaddoLibrary | 1 - MaddoShared/Properties/AssemblyInfo.cs | 6 +- imagecatalog/AssemblyInfo.cs | 4 +- imagecatalog/Logo.png | Bin 0 -> 317 bytes log.txt | 135 ------------------------- 6 files changed, 12 insertions(+), 146 deletions(-) delete mode 160000 MaddoLibrary create mode 100644 imagecatalog/Logo.png delete mode 100644 log.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a7ae755..fee2f0b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -88,7 +88,7 @@ build_windows: } artifacts: paths: - - "**/bin/$BUILD_CONFIG/net10.0-windows/**" + - "imagecatalog/bin/$BUILD_CONFIG/net10.0-windows/**" expire_in: 1 hour # Publish and create GitLab Release when building a tag. This job expects a Windows runner with PowerShell and curl available. @@ -112,7 +112,7 @@ publish_release: $dotnetExe = 'dotnet' } - & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -r win-x64 --self-contained false -o publish + & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -f net10.0-windows -r win-x64 --self-contained false /p:PublishSingleFile=true /p:PublishReadyToRun=true -o publish Write-Host "Published to $(pwd)\\publish" # Configure private NuGet source from GitLab Packages using CI_JOB_TOKEN @@ -130,8 +130,10 @@ publish_release: Write-Host 'No credentials available; skipping private NuGet source configuration.' } - # Find first file in publish folder - $file = Get-ChildItem -Path publish -File | Select-Object -First 1; Write-Host "Uploading $($file.FullName)" + # Find the produced EXE in publish folder (fallback to first file if no exe found) + $file = Get-ChildItem -Path publish -Filter *.exe -File | Select-Object -First 1 + if (-not $file) { $file = Get-ChildItem -Path publish -File | Select-Object -First 1 } + Write-Host "Uploading $($file.FullName)" # Upload to GitLab project uploads API to get a public URL for the artifact $uploadUrl = "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/uploads" $formData = "file=@$($file.FullName)" @@ -145,7 +147,7 @@ publish_release: } artifacts: paths: - - publish/* + - publish/*.exe expire_in: 1 day only: - tags diff --git a/MaddoLibrary b/MaddoLibrary deleted file mode 160000 index 5987cc2..0000000 --- a/MaddoLibrary +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5987cc26521d839bf81bdaab19d101488294da19 diff --git a/MaddoShared/Properties/AssemblyInfo.cs b/MaddoShared/Properties/AssemblyInfo.cs index 52a601e..6af8d79 100644 --- a/MaddoShared/Properties/AssemblyInfo.cs +++ b/MaddoShared/Properties/AssemblyInfo.cs @@ -8,10 +8,10 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("MaddoShared")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("Maddo")] [assembly: AssemblyProduct("MaddoShared")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] +[assembly: AssemblyCopyright("Copyright © 2021-2026")] +[assembly: AssemblyTrademark("Maddo")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible diff --git a/imagecatalog/AssemblyInfo.cs b/imagecatalog/AssemblyInfo.cs index 4767298..e5b467a 100644 --- a/imagecatalog/AssemblyInfo.cs +++ b/imagecatalog/AssemblyInfo.cs @@ -11,8 +11,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyDescription("")] -[assembly: AssemblyCopyright("(C) 2002-08")] -[assembly: AssemblyTrademark("")] +[assembly: AssemblyCopyright("(C) 2012-2026")] +[assembly: AssemblyTrademark("Maddo")] [assembly: CLSCompliant(true)] // The following GUID is for the ID of the typelib if this project is exposed to COM diff --git a/imagecatalog/Logo.png b/imagecatalog/Logo.png new file mode 100644 index 0000000000000000000000000000000000000000..849b093e8a89ad92d3546ec2edc2dbc6299bbd0b GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|zI(bjhFJ6_ zryO9qal_(YvT%E2{Qf$FLpOAGh@3pTr!DkP;4ZPe$v1&=j}L2oe*f3KT(*t-!_7Z$ z%b40MxX+~3_#H{r=;H3!IP>+fc%DkNIc~|uIj1ApfS~Pvxa>o{Ht7$Ih7Av67YiR| zKgPf|ZSQ%Bd!|;2H~v(vGdO(y^Ryqa2go+uS}R)TGVSKi!Pg#doDB>D22WQ% Jmvv4FO#tBnf_ne} literal 0 HcmV?d00001 diff --git a/log.txt b/log.txt deleted file mode 100644 index aa7e6df..0000000 --- a/log.txt +++ /dev/null @@ -1,135 +0,0 @@ -2021-03-06 10:04:44.068 +01:00 [INF] MSBuild registered from C:\Program Files\dotnet\sdk\5.0.200\ -2021-03-06 10:04:44.120 +01:00 [INF] Registered 1 extensions: - Default extension -2021-03-06 10:04:50.740 +01:00 [INF] Initializing upgrade step Select an entrypoint -2021-03-06 10:05:37.931 +01:00 [INF] Applying upgrade step Select an entrypoint -2021-03-06 10:05:56.095 +01:00 [INF] Upgrade step Select an entrypoint applied successfully -2021-03-06 10:05:59.578 +01:00 [INF] Initializing upgrade step Select project to upgrade -2021-03-06 10:06:53.914 +01:00 [INF] Applying upgrade step Select project to upgrade -2021-03-06 10:07:00.961 +01:00 [INF] Upgrade step Select project to upgrade applied successfully -2021-03-06 10:07:03.582 +01:00 [INF] Initializing upgrade step Back up project -2021-03-06 10:07:22.200 +01:00 [INF] Applying upgrade step Back up project -2021-03-06 10:07:26.114 +01:00 [INF] Backing up H:\dev\vs\Catalog\MaddoShared to H:\dev\vs\Catalog\MaddoShared.backup -2021-03-06 10:07:31.549 +01:00 [INF] Project backed up to H:\dev\vs\Catalog\MaddoShared.backup -2021-03-06 10:07:31.550 +01:00 [INF] Upgrade step Back up project applied successfully -2021-03-06 10:07:40.695 +01:00 [INF] Initializing upgrade step Convert project file to SDK style -2021-03-06 10:07:40.696 +01:00 [FTL] Try-Convert not found. This tool depends on the Try-Convert CLI tool. Please ensure that Try-Convert is installed and that the correct location for the tool is specified (in configuration, for example). https://github.com/dotnet/try-convert -2021-03-06 10:09:23.887 +01:00 [INF] Applying upgrade step Convert project file to SDK style -2021-03-06 10:09:23.889 +01:00 [INF] Converting project file format with try-convert -2021-03-06 10:09:27.336 +01:00 [INF] [try-convert] Conversion complete! -2021-03-06 10:09:27.915 +01:00 [INF] Project file converted successfully! The project may require additional changes to build successfully against the new .NET target. -2021-03-06 10:09:30.087 +01:00 [INF] Upgrade step Convert project file to SDK style applied successfully -2021-03-06 10:09:36.050 +01:00 [INF] Initializing upgrade step Update TFM -2021-03-06 10:09:48.944 +01:00 [INF] Applying upgrade step Update TFM -2021-03-06 10:09:54.879 +01:00 [INF] Upgrade step Update TFM applied successfully -2021-03-06 10:10:10.865 +01:00 [INF] Initializing upgrade step Update NuGet packages -2021-03-06 10:10:12.295 +01:00 [INF] Marking package System.Reflection.Metadata for removal because it appears to be a transitive dependency -2021-03-06 10:10:13.789 +01:00 [INF] Reference to .NET Upgrade Assistant analyzer package (Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, version 0.2.212405) needs added -2021-03-06 10:10:15.101 +01:00 [INF] Adding Microsoft.Windows.Compatibility 5.0.2 -2021-03-06 10:10:15.104 +01:00 [INF] Packages to be removed: -System.Reflection.Metadata, Version=5.0.0 -2021-03-06 10:10:15.105 +01:00 [INF] Packages to be addded: -Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.2.212405 -Microsoft.Windows.Compatibility, Version=5.0.2 -2021-03-06 10:10:18.926 +01:00 [INF] Applying upgrade step Update NuGet packages -2021-03-06 10:10:18.932 +01:00 [INF] Removing outdated package reference: System.Reflection.Metadata, Version=5.0.0 -2021-03-06 10:10:18.935 +01:00 [INF] Adding package reference: Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.2.212405 -2021-03-06 10:10:18.937 +01:00 [INF] Adding package reference: Microsoft.Windows.Compatibility, Version=5.0.2 -2021-03-06 10:10:24.287 +01:00 [INF] Marking package System.Data.DataSetExtensions for removal because it appears to be a transitive dependency -2021-03-06 10:10:24.292 +01:00 [INF] Marking package System.Numerics.Vectors for removal because it appears to be a transitive dependency -2021-03-06 10:10:24.706 +01:00 [INF] Removing outdated package reference: System.Data.DataSetExtensions, Version=4.5.0 -2021-03-06 10:10:24.707 +01:00 [INF] Removing outdated package reference: System.Numerics.Vectors, Version=4.5.0 -2021-03-06 10:10:27.413 +01:00 [INF] Upgrade step Update NuGet packages applied successfully -2021-03-06 10:10:36.907 +01:00 [INF] Initializing upgrade step Add template files -2021-03-06 10:10:36.924 +01:00 [INF] 0 expected template items needed -2021-03-06 10:10:36.926 +01:00 [INF] Initializing upgrade step Upgrade app config files -2021-03-06 10:10:36.944 +01:00 [INF] Found 0 app settings for upgrade: -2021-03-06 10:10:36.950 +01:00 [INF] 0 web page namespace imports need upgraded: -2021-03-06 10:10:36.951 +01:00 [INF] Initializing upgrade step Update C# source -2021-03-06 10:10:38.659 +01:00 [INF] Initializing upgrade step Move to next project -2021-03-06 10:10:43.824 +01:00 [INF] Applying upgrade step Move to next project -2021-03-06 10:10:43.825 +01:00 [INF] Upgrade step Move to next project applied successfully -2021-03-06 10:11:07.545 +01:00 [INF] Initializing upgrade step Select project to upgrade -2021-03-06 10:11:10.510 +01:00 [INF] Applying upgrade step Select project to upgrade -2021-03-06 10:11:14.382 +01:00 [INF] Upgrade step Select project to upgrade applied successfully -2021-03-06 10:11:17.877 +01:00 [INF] Initializing upgrade step Back up project -2021-03-06 10:11:21.030 +01:00 [INF] Applying upgrade step Back up project -2021-03-06 10:11:22.810 +01:00 [INF] Backing up H:\dev\vs\Catalog\imagecatalog to H:\dev\vs\Catalog\imagecatalog.backup -2021-03-06 10:11:37.349 +01:00 [INF] Project backed up to H:\dev\vs\Catalog\imagecatalog.backup -2021-03-06 10:11:37.350 +01:00 [INF] Upgrade step Back up project applied successfully -2021-03-06 10:11:47.584 +01:00 [INF] Initializing upgrade step Convert project file to SDK style -2021-03-06 10:11:49.609 +01:00 [INF] Applying upgrade step Convert project file to SDK style -2021-03-06 10:11:49.610 +01:00 [INF] Converting project file format with try-convert -2021-03-06 10:11:52.238 +01:00 [INF] [try-convert] Conversion complete! -2021-03-06 10:11:52.666 +01:00 [INF] Project file converted successfully! The project may require additional changes to build successfully against the new .NET target. -2021-03-06 10:11:55.581 +01:00 [INF] Upgrade step Convert project file to SDK style applied successfully -2021-03-06 10:12:00.489 +01:00 [INF] Initializing upgrade step Update TFM -2021-03-06 10:12:03.093 +01:00 [INF] Applying upgrade step Update TFM -2021-03-06 10:12:06.038 +01:00 [INF] Upgrade step Update TFM applied successfully -2021-03-06 10:12:10.906 +01:00 [INF] Initializing upgrade step Update NuGet packages -2021-03-06 10:12:12.592 +01:00 [INF] Marking package Ben.Demystifier for removal because it appears to be a transitive dependency -2021-03-06 10:12:12.607 +01:00 [INF] Marking package System.Buffers for removal because it appears to be a transitive dependency -2021-03-06 10:12:12.624 +01:00 [INF] Marking package System.Collections.Immutable for removal because it appears to be a transitive dependency -2021-03-06 10:12:12.628 +01:00 [INF] Marking package System.Memory for removal because it appears to be a transitive dependency -2021-03-06 10:12:12.630 +01:00 [INF] Marking package System.Numerics.Vectors for removal because it appears to be a transitive dependency -2021-03-06 10:12:12.633 +01:00 [INF] Marking package System.Reflection.Metadata for removal because it appears to be a transitive dependency -2021-03-06 10:12:12.637 +01:00 [INF] Marking package System.Runtime.CompilerServices.Unsafe for removal because it appears to be a transitive dependency -2021-03-06 10:12:12.640 +01:00 [INF] Marking package System.Threading.Tasks.Extensions for removal because it appears to be a transitive dependency -2021-03-06 10:12:14.097 +01:00 [INF] Reference to .NET Upgrade Assistant analyzer package (Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, version 0.2.212405) needs added -2021-03-06 10:12:14.104 +01:00 [INF] Packages to be removed: -Ben.Demystifier, Version=0.3.0 -System.Buffers, Version=4.5.1 -System.Collections.Immutable, Version=5.0.0 -System.Memory, Version=4.5.4 -System.Numerics.Vectors, Version=4.5.0 -System.Reflection.Metadata, Version=5.0.0 -System.Runtime.CompilerServices.Unsafe, Version=5.0.0 -System.Threading.Tasks.Extensions, Version=4.5.4 -2021-03-06 10:12:14.104 +01:00 [INF] Packages to be addded: -Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.2.212405 -2021-03-06 10:12:16.572 +01:00 [INF] Applying upgrade step Update NuGet packages -2021-03-06 10:12:16.573 +01:00 [INF] Removing outdated package reference: Ben.Demystifier, Version=0.3.0 -2021-03-06 10:12:16.573 +01:00 [INF] Removing outdated package reference: System.Buffers, Version=4.5.1 -2021-03-06 10:12:16.574 +01:00 [INF] Removing outdated package reference: System.Collections.Immutable, Version=5.0.0 -2021-03-06 10:12:16.575 +01:00 [INF] Removing outdated package reference: System.Memory, Version=4.5.4 -2021-03-06 10:12:16.576 +01:00 [INF] Removing outdated package reference: System.Numerics.Vectors, Version=4.5.0 -2021-03-06 10:12:16.578 +01:00 [INF] Removing outdated package reference: System.Reflection.Metadata, Version=5.0.0 -2021-03-06 10:12:16.578 +01:00 [INF] Removing outdated package reference: System.Runtime.CompilerServices.Unsafe, Version=5.0.0 -2021-03-06 10:12:16.580 +01:00 [INF] Removing outdated package reference: System.Threading.Tasks.Extensions, Version=4.5.4 -2021-03-06 10:12:16.581 +01:00 [INF] Adding package reference: Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.2.212405 -2021-03-06 10:12:19.366 +01:00 [INF] Upgrade step Update NuGet packages applied successfully -2021-03-06 10:12:35.849 +01:00 [INF] Initializing upgrade step Add template files -2021-03-06 10:12:35.850 +01:00 [INF] 0 expected template items needed -2021-03-06 10:12:35.851 +01:00 [INF] Initializing upgrade step Upgrade app config files -2021-03-06 10:12:35.852 +01:00 [INF] Found 0 app settings for upgrade: -2021-03-06 10:12:35.853 +01:00 [INF] system.diagnostics is not supported in .NET 5. See https://github.com/dotnet/runtime/issues/23937 for details. For now, it will be disabled. -2021-03-06 10:12:35.854 +01:00 [INF] 0 web page namespace imports need upgraded: -2021-03-06 10:12:40.725 +01:00 [INF] Applying upgrade step Disable unsupported configuration sections -2021-03-06 10:12:40.727 +01:00 [INF] system.diagnostics is not supported in .NET 5. See https://github.com/dotnet/runtime/issues/23937 for details. For now, it will be disabled. -2021-03-06 10:12:40.730 +01:00 [INF] Configuration file H:\dev\vs\Catalog\imagecatalog\app.config has been updated -2021-03-06 10:12:40.737 +01:00 [INF] Upgrade step Disable unsupported configuration sections applied successfully -2021-03-06 10:12:40.739 +01:00 [INF] Applying upgrade step Upgrade app config files -2021-03-06 10:12:40.740 +01:00 [INF] Upgrade step Upgrade app config files applied successfully -2021-03-06 10:12:43.598 +01:00 [INF] Initializing upgrade step Update C# source -2021-03-06 10:12:44.173 +01:00 [INF] Initializing upgrade step Move to next project -2021-03-06 10:12:47.488 +01:00 [INF] Applying upgrade step Move to next project -2021-03-06 10:12:47.489 +01:00 [INF] Upgrade step Move to next project applied successfully -2021-03-06 10:12:48.833 +01:00 [INF] Initializing upgrade step Select project to upgrade -2021-03-06 10:12:50.361 +01:00 [INF] Applying upgrade step Select project to upgrade -2021-03-06 10:12:54.374 +01:00 [ERR] Unknown selection: '' -2021-03-06 10:13:02.205 +01:00 [ERR] Unknown selection: '' -2021-03-06 10:13:04.059 +01:00 [ERR] Unknown selection: 'exit' -2021-03-06 10:13:06.542 +01:00 [ERR] Unknown selection: '0' -2021-03-06 10:13:08.242 +01:00 [INF] Saving upgrade progress file at H:\dev\vs\Catalog\.upgrade-assistant -2021-03-06 10:13:13.625 +01:00 [INF] MSBuild registered from C:\Program Files\dotnet\sdk\5.0.200\ -2021-03-06 10:13:13.651 +01:00 [INF] Registered 1 extensions: - Default extension -2021-03-06 10:13:15.795 +01:00 [INF] Loading upgrade progress file at H:\dev\vs\Catalog\.upgrade-assistant -2021-03-06 10:13:17.819 +01:00 [INF] Initializing upgrade step Select project to upgrade -2021-03-06 10:13:29.438 +01:00 [INF] Skipping upgrade step Select project to upgrade -2021-03-06 10:13:29.440 +01:00 [INF] Upgrade step Select project to upgrade skipped -2021-03-06 10:13:31.325 +01:00 [INF] Initializing upgrade step Finalize Solution -2021-03-06 10:13:34.820 +01:00 [INF] Applying upgrade step Finalize Solution -2021-03-06 10:13:34.821 +01:00 [INF] Upgrade step Finalize Solution applied successfully -2021-03-06 10:13:36.563 +01:00 [INF] Upgrade has completed. Please review any changes. -2021-03-06 10:13:36.565 +01:00 [INF] Saving upgrade progress file at H:\dev\vs\Catalog\.upgrade-assistant From f8d4687a9741db7a0c62b8500a50d3d5abc7d7af Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 21 Feb 2026 20:01:31 +0100 Subject: [PATCH 19/69] Refactor CI pipeline for GitLab: streamline publish_release job and improve artifact handling --- .gitlab-ci.yml | 91 ++++++++++++++++++++------------------------------ 1 file changed, 36 insertions(+), 55 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fee2f0b..452d9da 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,66 +91,47 @@ build_windows: - "imagecatalog/bin/$BUILD_CONFIG/net10.0-windows/**" expire_in: 1 hour -# Publish and create GitLab Release when building a tag. This job expects a Windows runner with PowerShell and curl available. +# Publish and create GitLab Release when building a tag. publish_release: stage: publish - tags: - - saas-windows-medium-amd64 + image: mcr.microsoft.com/dotnet/sdk:10.0 needs: - - build_windows - script: - - | - powershell -NoProfile -Command { - # Ensure .NET 10 SDK is available (install to user folder if missing) and use that dotnet for publish - $needsInstall = -not (dotnet --list-sdks 2>$null | Select-String '^10\.') - if ($needsInstall) { - Write-Host 'Installing .NET 10 SDK using dotnet-install.ps1' - Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile dotnet-install.ps1 -UseBasicParsing - .\dotnet-install.ps1 -Channel 10.0 -InstallDir $env:USERPROFILE\.dotnet - $dotnetExe = Join-Path $env:USERPROFILE '.dotnet\dotnet.exe' - } else { - $dotnetExe = 'dotnet' - } - - & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -f net10.0-windows -r win-x64 --self-contained false /p:PublishSingleFile=true /p:PublishReadyToRun=true -o publish - Write-Host "Published to $(pwd)\\publish" - - # Configure private NuGet source from GitLab Packages using CI_JOB_TOKEN - # Fallback to repository variables NUGET_USERNAME/NUGET_PASSWORD for shared runners - $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' - if ($env:CI_JOB_TOKEN) { - Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using CI_JOB_TOKEN...' - try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} - & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text - } elseif ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { - Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using NUGET_USERNAME/NUGET_PASSWORD...' - try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} - & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text - } else { - Write-Host 'No credentials available; skipping private NuGet source configuration.' - } - - # Find the produced EXE in publish folder (fallback to first file if no exe found) - $file = Get-ChildItem -Path publish -Filter *.exe -File | Select-Object -First 1 - if (-not $file) { $file = Get-ChildItem -Path publish -File | Select-Object -First 1 } - Write-Host "Uploading $($file.FullName)" - # Upload to GitLab project uploads API to get a public URL for the artifact - $uploadUrl = "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/uploads" - $formData = "file=@$($file.FullName)" - $uploadResp = curl --silent --show-error --header "JOB-TOKEN:$env:CI_JOB_TOKEN" --form $formData $uploadUrl - $uploadJson = $uploadResp | ConvertFrom-Json - $assetUrl = "$env:CI_SERVER_URL$($uploadJson.url)" - Write-Host "Uploaded asset url: $assetUrl" - # Create the release using uploads URL - $body = @{ name = $env:CI_COMMIT_TAG; tag_name = $env:CI_COMMIT_TAG; description = "Automated release from CI"; assets = @{ links = @(@{ name = "$($file.Name)"; url = $assetUrl }) } } | ConvertTo-Json -Depth 10 - Invoke-RestMethod -Method Post -Uri "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/releases" -Headers @{ "JOB-TOKEN" = $env:CI_JOB_TOKEN } -Body $body -ContentType "application/json" - } + - job: build_windows + artifacts: true + script: | + set -euo pipefail + dotnet --info + echo "Reading MinVer version from build artifacts" + # locate a minversion file produced by the build artifacts + minfile=$(find imagecatalog -type f -iname 'minversion' -print | head -n1 || true) + if [ -z "$minfile" ]; then minfile=$(find . -type f -iname 'minversion' -print | head -n1 || true); fi + if [ -z "$minfile" ]; then echo "No minversion file found in artifacts"; exit 1; fi + echo "Found minversion file: $minfile" + version=$(cat "$minfile" | tr -d '\r\n') + if [ -z "$version" ]; then echo "minversion was empty"; exit 1; fi + echo "Using version: $version" + # find the primary artifact to upload (prefer the executable or first file under the build output) + file=$(find imagecatalog/bin -type f \! -iname 'minversion' -print | head -n1 || true) + if [ -z "$file" ]; then file=$(find . -type f -name 'ImageCatalog.*' -print | head -n1 || true); fi + if [ -z "$file" ]; then echo "No artifact file found to attach"; exit 1; fi + echo "Uploading artifact: $file" + uploadResp=$(curl --silent --show-error --header "JOB-TOKEN:$CI_JOB_TOKEN" --form "file=@$file" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/uploads") + assetPath=$(echo "$uploadResp" | sed -n 's/.*"url":"\([^\"]*\)".*/\1/p') + if [ -z "$assetPath" ]; then echo "Upload failed: $uploadResp"; exit 1; fi + assetUrl="$CI_SERVER_URL$assetPath" + echo "Uploaded asset url: $assetUrl" + basename=$(basename "$file") + # create release JSON using the exact minversion value as tag_name + cat > release.json < Date: Sat, 21 Feb 2026 20:11:46 +0100 Subject: [PATCH 20/69] Removed tags only from publish job --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 452d9da..e0ccef7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -129,8 +129,8 @@ publish_release: curl --silent --show-error --header "JOB-TOKEN:$CI_JOB_TOKEN" -X POST -H "Content-Type: application/json" --data @release.json "$CI_API_V4_URL/projects/$CI_PROJECT_ID/releases" artifacts: expire_in: 1 day - only: - - tags +# only: +# - tags # Notes for runner setup: The job now runs on the public .NET SDK image and downloads artifacts from the # `build_windows` job via `needs`. It reads the `minversion` file produced by the build artifacts and From 335da52abfd73567a9daed2bb967963e270667ca Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sun, 22 Feb 2026 00:57:23 +0100 Subject: [PATCH 21/69] Add minversion file generation to build output for downstream jobs --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0ccef7..f13eb57 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,6 +85,23 @@ build_windows: } & $dotnetExe restore & $dotnetExe build "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -v minimal + # Write a minversion file into the build output so downstream jobs can read the computed version. + try { + $outRoot = Join-Path -Path "imagecatalog\bin\$env:BUILD_CONFIG" -ChildPath '*' + # search under the build output for a file starting with ImageCatalog. + $built = Get-ChildItem -Path (Join-Path "imagecatalog\bin\$env:BUILD_CONFIG" '.') -Recurse -File -ErrorAction SilentlyContinue | Where-Object { $_.Name -like 'ImageCatalog.*' } | Select-Object -First 1 + if ($built) { + $base = [System.IO.Path]::GetFileNameWithoutExtension($built.Name) + $version = $base -replace '^ImageCatalog\.', '' + $minPath = Join-Path $built.DirectoryName 'minversion' + Write-Host "Writing minversion '$version' to $minPath" + Set-Content -Path $minPath -Value $version -Encoding UTF8 + } else { + Write-Host 'No ImageCatalog build artifact found to derive minversion from.' + } + } catch { + Write-Host "Failed to write minversion: $_" + } } artifacts: paths: From 3a964bbbcf09cf6902dc2f3e242bcf88a3a9ceaf Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sun, 22 Feb 2026 11:38:15 +0100 Subject: [PATCH 22/69] Refactor CI pipeline: replace minversion file generation with single-file publish for downstream jobs --- .gitlab-ci.yml | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f13eb57..f257f27 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,52 +85,45 @@ build_windows: } & $dotnetExe restore & $dotnetExe build "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -v minimal - # Write a minversion file into the build output so downstream jobs can read the computed version. + # Produce a single-file, ready-to-run publish so downstream jobs only need the EXE. try { - $outRoot = Join-Path -Path "imagecatalog\bin\$env:BUILD_CONFIG" -ChildPath '*' - # search under the build output for a file starting with ImageCatalog. - $built = Get-ChildItem -Path (Join-Path "imagecatalog\bin\$env:BUILD_CONFIG" '.') -Recurse -File -ErrorAction SilentlyContinue | Where-Object { $_.Name -like 'ImageCatalog.*' } | Select-Object -First 1 - if ($built) { - $base = [System.IO.Path]::GetFileNameWithoutExtension($built.Name) - $version = $base -replace '^ImageCatalog\.', '' - $minPath = Join-Path $built.DirectoryName 'minversion' - Write-Host "Writing minversion '$version' to $minPath" - Set-Content -Path $minPath -Value $version -Encoding UTF8 - } else { - Write-Host 'No ImageCatalog build artifact found to derive minversion from.' - } + & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:PublishReadyToRun=true -o "imagecatalog\bin\$env:BUILD_CONFIG\net10.0-windows\publish" -v minimal } catch { - Write-Host "Failed to write minversion: $_" + Write-Host "dotnet publish failed: $_" + throw } } artifacts: paths: - - "imagecatalog/bin/$BUILD_CONFIG/net10.0-windows/**" + - "imagecatalog/bin/$BUILD_CONFIG/net10.0-windows/publish/**" expire_in: 1 hour # Publish and create GitLab Release when building a tag. publish_release: stage: publish image: mcr.microsoft.com/dotnet/sdk:10.0 + variables: + GIT_DEPTH: 0 needs: - job: build_windows artifacts: true script: | set -euo pipefail dotnet --info - echo "Reading MinVer version from build artifacts" - # locate a minversion file produced by the build artifacts - minfile=$(find imagecatalog -type f -iname 'minversion' -print | head -n1 || true) - if [ -z "$minfile" ]; then minfile=$(find . -type f -iname 'minversion' -print | head -n1 || true); fi - if [ -z "$minfile" ]; then echo "No minversion file found in artifacts"; exit 1; fi - echo "Found minversion file: $minfile" - version=$(cat "$minfile" | tr -d '\r\n') - if [ -z "$version" ]; then echo "minversion was empty"; exit 1; fi + export PATH="$PATH:$HOME/.dotnet/tools" + echo "Installing minver-cli" + dotnet tool install --global minver-cli --version 7.0.0 + # Ensure we have full git history and tags for MinVer to compute an accurate version + git fetch --prune --unshallow || true + git fetch --tags || true + echo "Computing version with minver-cli" + version=$(minver 2>/dev/null | tail -n1 || true) + if [ -z "$version" ]; then echo "minver failed to produce a version"; exit 1; fi echo "Using version: $version" - # find the primary artifact to upload (prefer the executable or first file under the build output) - file=$(find imagecatalog/bin -type f \! -iname 'minversion' -print | head -n1 || true) - if [ -z "$file" ]; then file=$(find . -type f -name 'ImageCatalog.*' -print | head -n1 || true); fi - if [ -z "$file" ]; then echo "No artifact file found to attach"; exit 1; fi + # find the single-file exe from the publish output + file=$(find imagecatalog/bin -type f -iname '*.exe' -print | head -n1 || true) + if [ -z "$file" ]; then file=$(find imagecatalog -type f -iname '*.exe' -print | head -n1 || true); fi + if [ -z "$file" ]; then echo "No artifact EXE found to attach"; exit 1; fi echo "Uploading artifact: $file" uploadResp=$(curl --silent --show-error --header "JOB-TOKEN:$CI_JOB_TOKEN" --form "file=@$file" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/uploads") assetPath=$(echo "$uploadResp" | sed -n 's/.*"url":"\([^\"]*\)".*/\1/p') @@ -138,7 +131,6 @@ publish_release: assetUrl="$CI_SERVER_URL$assetPath" echo "Uploaded asset url: $assetUrl" basename=$(basename "$file") - # create release JSON using the exact minversion value as tag_name cat > release.json < Date: Sun, 22 Feb 2026 11:48:32 +0100 Subject: [PATCH 23/69] Made trimmed false --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f257f27..fb87b2e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,7 +87,7 @@ build_windows: & $dotnetExe build "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -v minimal # Produce a single-file, ready-to-run publish so downstream jobs only need the EXE. try { - & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:PublishReadyToRun=true -o "imagecatalog\bin\$env:BUILD_CONFIG\net10.0-windows\publish" -v minimal + & $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -p:PublishReadyToRun=true -o "imagecatalog\bin\$env:BUILD_CONFIG\net10.0-windows\publish" -v minimal } catch { Write-Host "dotnet publish failed: $_" throw From 3ae4da3e494fff81e189381902472553b56609dc Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sun, 22 Feb 2026 14:51:44 +0100 Subject: [PATCH 24/69] Enhance publish_release job: export version and add release metadata for automated releases --- .gitlab-ci.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb87b2e..050a0aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -120,6 +120,7 @@ publish_release: version=$(minver 2>/dev/null | tail -n1 || true) if [ -z "$version" ]; then echo "minver failed to produce a version"; exit 1; fi echo "Using version: $version" + export VERSION="$version" # find the single-file exe from the publish output file=$(find imagecatalog/bin -type f -iname '*.exe' -print | head -n1 || true) if [ -z "$file" ]; then file=$(find imagecatalog -type f -iname '*.exe' -print | head -n1 || true); fi @@ -131,13 +132,18 @@ publish_release: assetUrl="$CI_SERVER_URL$assetPath" echo "Uploaded asset url: $assetUrl" basename=$(basename "$file") - cat > release.json < Date: Thu, 26 Feb 2026 18:43:07 +0100 Subject: [PATCH 25/69] Add Avalonia UI frontend alongside WinForms and WPF Introduce Avalonia as a new cross-platform UI option, including new XAML and code-behind files for the application and main window. Update Program.cs to support a --avalonia launch argument and add corresponding launch profile. Integrate Avalonia NuGet packages and ensure DataModel supports UI-thread invocation for all frontends. All business logic and state are shared via DI, enabling consistent behavior across WinForms, WPF, and Avalonia. --- imagecatalog/AvaloniaApp.axaml | 8 + imagecatalog/AvaloniaApp.axaml.cs | 20 ++ imagecatalog/AvaloniaMainWindow.axaml | 317 ++++++++++++++++++++ imagecatalog/AvaloniaMainWindow.axaml.cs | 151 ++++++++++ imagecatalog/DataModel.cs | 12 +- imagecatalog/ImageCatalog 2.csproj | 4 + imagecatalog/Program.cs | 23 +- imagecatalog/Properties/launchSettings.json | 9 +- 8 files changed, 535 insertions(+), 9 deletions(-) create mode 100644 imagecatalog/AvaloniaApp.axaml create mode 100644 imagecatalog/AvaloniaApp.axaml.cs create mode 100644 imagecatalog/AvaloniaMainWindow.axaml create mode 100644 imagecatalog/AvaloniaMainWindow.axaml.cs diff --git a/imagecatalog/AvaloniaApp.axaml b/imagecatalog/AvaloniaApp.axaml new file mode 100644 index 0000000..8ce9be1 --- /dev/null +++ b/imagecatalog/AvaloniaApp.axaml @@ -0,0 +1,8 @@ + + + + + + diff --git a/imagecatalog/AvaloniaApp.axaml.cs b/imagecatalog/AvaloniaApp.axaml.cs new file mode 100644 index 0000000..9a14f4d --- /dev/null +++ b/imagecatalog/AvaloniaApp.axaml.cs @@ -0,0 +1,20 @@ +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; +using Microsoft.Extensions.DependencyInjection; + +namespace ImageCatalog_2; + +public partial class AvaloniaApp : Avalonia.Application +{ + public override void Initialize() => AvaloniaXamlLoader.Load(this); + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + var model = Program.ServiceProvider.GetRequiredService(); + desktop.MainWindow = new AvaloniaMainWindow(model); + } + base.OnFrameworkInitializationCompleted(); + } +} diff --git a/imagecatalog/AvaloniaMainWindow.axaml b/imagecatalog/AvaloniaMainWindow.axaml new file mode 100644 index 0000000..a16b949 --- /dev/null +++ b/imagecatalog/AvaloniaMainWindow.axaml @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WPFCatalog/Controls/GeneralSettingsControl.xaml.cs b/WPFCatalog/Controls/GeneralSettingsControl.xaml.cs deleted file mode 100644 index af3e0aa..0000000 --- a/WPFCatalog/Controls/GeneralSettingsControl.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace WPFCatalog.Controls -{ - /// - /// Interaction logic for GeneralSettingsControl.xaml - /// - public partial class GeneralSettingsControl : UserControl - { - public GeneralSettingsControl() - { - InitializeComponent(); - } - } -} diff --git a/WPFCatalog/Controls/TextSettingsControl.xaml b/WPFCatalog/Controls/TextSettingsControl.xaml deleted file mode 100644 index 7d7ac19..0000000 --- a/WPFCatalog/Controls/TextSettingsControl.xaml +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WPFCatalog/Controls/TextSettingsControl.xaml.cs b/WPFCatalog/Controls/TextSettingsControl.xaml.cs deleted file mode 100644 index 2c29c51..0000000 --- a/WPFCatalog/Controls/TextSettingsControl.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace WPFCatalog.Controls -{ - /// - /// Interaction logic for TextSettingsControl.xaml - /// - public partial class TextSettingsControl : UserControl - { - public TextSettingsControl() - { - InitializeComponent(); - } - } -} diff --git a/WPFCatalog/Converters/FontFamilyStringConverter.cs b/WPFCatalog/Converters/FontFamilyStringConverter.cs deleted file mode 100644 index 66a103e..0000000 --- a/WPFCatalog/Converters/FontFamilyStringConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; -using System.Windows.Media; - -namespace WPFCatalog -{ - public class FontFamilyStringConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - FontFamily fontfamily = new FontFamily("Verdana"); - if (value != null) - { - fontfamily = new FontFamily(value.ToString()); - } - return fontfamily; - - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/WPFCatalog/Converters/MaddoColorConverter.cs b/WPFCatalog/Converters/MaddoColorConverter.cs deleted file mode 100644 index 2248484..0000000 --- a/WPFCatalog/Converters/MaddoColorConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Data; -using System.Windows.Media; - -namespace WPFCatalog -{ - public class MaddoColorConverter : IValueConverter - { - private static readonly DependencyObject _dummy = new DependencyObject(); - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - Color color = Colors.Black; - - if (value != null && value != DependencyProperty.UnsetValue && value is string && !String.IsNullOrWhiteSpace((string)value)) - { - string c = (string)value; - object convertedColor = null; - try - { - convertedColor = ColorConverter.ConvertFromString(c); - } - catch (Exception ex) - { - if (!DesignerProperties.GetIsInDesignMode(_dummy)) - { - throw new FormatException($"String {c} does not represent a valid color", ex); - } - } - if (convertedColor != null) - { - color = (Color)convertedColor; - } - } - - return color; - - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null) - { - Color color = (Color)value; - Debug.WriteLine(color.ToString()); - return color.ToString(); - } - return string.Empty; - } - } -} diff --git a/WPFCatalog/Icons/camera-photo-5.png b/WPFCatalog/Icons/camera-photo-5.png deleted file mode 100644 index 1e54dea89239f7aecab3e55382432a57c6c60e54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1231 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkEj_j@0&dJZ`)n?tl_D>YcrteH1n%v&r z_6D}Ly{R)T`VJp%U+u(U_=)Yn=RMi8mff8cWF)~OFv~$-WW{y$A1{yZestu=+3oSG z&-%`<+PkhrV8*hQ4ewnRUknIe7pLYMye{r1*HV%4X?dHU{>ck| zs(0@WS#7Fw`q{JI+3dR#C0qjge}50puz&x+!tD24v(58kk8ISvq@u{d^zUx|=RKci zEV-XtS~}Hxx}E&G32B;t>-d*GSbscw&PTgr*5=;!Ih!|bJNz+$VW-kr)vZyzZ`bDD zdOKmUiX>CfOy#944wp^VJktDE_l13#;i38c*D_eE=SXQ^&Zs#wS>6BV2j%{}<;_*M zMMau++<$!Y9pArWY%f0w28tA3$P_MhR$G2Mg#cHe}xXv-#y^E~XyA zxp~`9A3DSo931>4sOiiJqfXd0L&cpl=vk}N&X|36 zR#siFuT9OI5uz=6u{*hMGRsntvuTqJcr5E5+63w^3R~NB>hgxW7av*Fso9+0z3la` zwK}Jb8WcDl6>k>z+SPEbj{Eec6(L$J4;h2fmSlDXd2uNQExq!+>AH!r@n_8fu^&N~ zx18ouV|nwmav#qfwrkg~UoZFjqtCGHz5VvaE%BhFZ(8CSQR1ARo12WKm#mw4Gnb-4MGept&A*)L>|!Yha{nWDsIx zY-MC-Wn>7^Q1iRK5Jf|7eoAIqB~$~@2Ez~o3oBDIE0BJW4IybSR|7Q|ft=)%nVgze zoXU_|`z^)3Ja diff --git a/WPFCatalog/Icons/document-open-6.png b/WPFCatalog/Icons/document-open-6.png deleted file mode 100644 index fe03b7f429925fe2a0d967ce4ac873644a773707..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1028 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(^vlDyqr zfHV;NblzPLq&N#aB8!2v2N=7Z%(epwmK8Xr18J~%3^B*n9%f)*{Nw537-DgH>cq3& zA%POd>Yv|RtZZy%X4!2LzBcQ+Q_L2PNgf5lYk%F?dio#p;@o=2gCZ^g21;8z7K(`p zvNXClg^7qXb=KafSyi0Ar}(^kcX7L*{+Ex3BIkVm^yl2?J?l4I`?TDu^3jh=KYq-t zxsbK;?)#gyH}9qU&-dZ>J3s&EvCf0Y2MTI=7~45>E}r*JU;y5#YWRk z_2+L6r8w!UX%u{UwNQR)S@u@PU2#nMYAtMh{SHewRS!J6zNB=wLFbGIzpBn$%L5w{$|YkN(F5kei=+)V)ST;=l!vT@w@nB zzjaS+`1qQx+~o*lab`adrLB74*fin)dnU5n+4I)Wh#^k8r651bc^`X=>Qjc>>pmu_ z{yW%Ubm7{Bciw`gSu&F6R3BIwNs247g+%L3HxkHX*AVHxv$I_M!v=>9D_@-V@|rEU zI^Hfs#bKo&Gt>6un}Q%+xA%j6NPGtYeY$MQEFmIs%{F9U@$T;u+%j))HO5>F*LI>u&^>Q)HN`- zGB8kC_wWHs14yM6L>Ewlp@FV}k*<+Jh>@|Ck(rgDDMSOCbxb3QhTQy=%(P0V2A~aw zAqJLKh89-F77z_#T2`z;4W=L``D7-i<`t(hWR#Q?Sn2D7?aC}mP0r8F&Ce^=%P&gT z&w(f@*7tD_@X}xJ3eHBg8TSeyWzAeg&vO5@cg=ep*R+Vo@rCV@iHfs)A>3 zVtQ&&YGO)d;mK4Rpdwy~qSB(|R0hA&vizLHHU6d_ff6PNiTKbUADENN%ggmLlk@X* ovorJ3^?(l7FDS~-N=+^)*3ScL*Dtf(0?OwMp00i_>zopr0HQU2XaE2J diff --git a/WPFCatalog/Icons/document-open-folder.png b/WPFCatalog/Icons/document-open-folder.png deleted file mode 100644 index 98b8a9448a5756451eadce70af3772be1f543993..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 852 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE0z%d<2gY`4S99w&sfq~J`)5S5w;`Gv>-CoX)0=DVp@A8@$w+gyk zW?Ac-n7w$Ze1a7Bf29fX7vwoQ4Hb2pPwpZlyzw76$+xg?=UZ@v)2#b0dFKL^yir1f2 zt+>ggS-@fCtq(Ex_jLpt?sq=QxidndJz~ivPG#4%|6CrooJiGKz_z#ckGRXBLZ=S# z=AO+0v)?T_Dip_agq^3>;pDE8aM_iI*m+c6pSkz-@$0O_tezzH&kKY#UzwjTyf!m7 z^Zxy?Tjg_SuDX&L3oGvKvI+89`ut4Jd~asWlEpt6A96=DZ(*2U2MkHo64!{5 z9nO2Eg!<&1*zW_C)gPi1(nVgzeoXU_vn(|^KQ}i&uUId?C|y4XqNG?qsZzH%QQuh4KwlxhNP!p~KJEcN`bK(&`qBM1 z$uKuUoQD(&2FALEmLY})R;ET)ra(`b0X=n7{@W&?21$?`gY(l$$`gxH8OqDc^)mCa zi<1)zQbA6e{mw=Ts7M&1sI(|KmBGKFGCeg(}6TtKSRv1wTBrPn7KV&978Nlr%v|Gh)I=bo&Wo;wf)BANB+lH zZr#}B5o^+8+L$5Qy-U#1iIvysU@Yf~)wiYwvButzat`B-xU*uVM@H@%-G43tQj^)d z7W)J%-S|_s$awOSnP*app4WY^yZ>4#WJzUsdZC3(#rekt*L!OnXBXX-b1CiYoW&@! z^pk@4nj8M}>*lWf|9h_WqhkUeiv*-U2=%r{^UL%vm#cAGSz+wqA#x@_^IuMWobA%y zILpfu9`x4Uees{Et*s!sx!#%UvxHbreyWK`4UUy z4@my*x%;tgS{ekt}^R9TRuU@Dh;*ZcQBo}}6huiwqJZY#kX63?F2!>&{5{m#E5RSSj=Ipl6nrGf)3-(>lN8FHB}<1h0ujo;_dm*Gnu}Ye(ta zkZJnSg%bCw9`F60dV6=>s_CaP^TKbP^!*yBtDC6A+wi*bPVoH`>$Yw0Jk3!0lKDEv*`k$L8nUW>zoz5M?3q8`t~_h) z{E0#A@wXX!e>yMkxP0-`jgKxn44XdIAAMnYgv}yPYWq8edwt?NO82f0nfkhB9#JiEjVMVjN=+$?Z| z=o{%7=;vgyt$bP0l+XkK^*s1x diff --git a/WPFCatalog/Icons/format-justify-left-2.png b/WPFCatalog/Icons/format-justify-left-2.png deleted file mode 100644 index d6abc0585efd6d5e4a41f17f3545b877c432432c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3517 zcmZXWcT`hNyTu2PVh|}x*C0(%DFGrS0ff+{h!7PO1?i!M5~>10M1d$ZG(iNUqe6%v zN)ZquQeS%S3K9`%p-B7U>;2YUcipqr%wA_^|JHuy%=zPqGBefZfCxbV033z}I_7lc z`ZL&A=(EV$!Ckr>a?&!<0)P~Af9Faf01$PIwze6@&JKWpk>?gpXp03t_05TOlu;y} zXoNNAWjke#BH+=O9G(P_{ZN2Mb1|~8J~Bt_0k7b3uljE8IFeX&gcfO&A&^aKc1lVK zJ;6C46ilA0RmN_V)^4aeJ^z&vtO4|F%5he# zD6;`lt?`jQ3}xxSCLz0>2yA`<{PVMX_Doy?z$S-_-GYH_1JuXq>n;N}MFy!S#L|GC z>sF$j762@l+Y`Pe5YfyYqHmi{THSshkfoxm{mN|U;o*l1jPKdz9UNK@^)!P-MJ9mP z^V7j|c5cq9BC8O{QI!$I{ffc^pzERVA9t@!ElMjlzxmbWa zOL(F`CxC6IADna+1X;rg$4>w}KX(Ls(rU&R0S16)gPSocIfrWqgfkD}#jEhhfH0Bv zM`n=^R4f6?Ai_9KTUI*as@WmQGVV$g@8YAIg^%@A7-c*eI~$p+7zd~L)bMu%@bfST z*5-s3mqMeCWu%fVK2>ZWQoK>uQ8dH=#uL^g8f5?x(gQc93kQS3ZL*yxDV`b}jc(joNC32UzoYo>i<#`?Dp`#(6oQi6fDy%2 zwAOU1iD5>VC#p#_Ez!y#ELX)`2y?iI_%^Xm2cbqKrwj#a@Cb4rm5+M-za0`XjqY<}_;*CO}6 zl0F8iipg_F)3q$!?jGk7=cKoKBY`8@Bj*v%J#_r@9`{PFC#_%lefPI+kjS38cKF@q zDR~}&OB5DL2t|;hPC0)%5kpzGr6}^YbF>G|sm|HWA$gOdUqh^QbIVbAH}h_M`_RgM zwYa#b_#Kt8|9(HD|7G#@tNML~E{-m07s5uoD_kmOUHtnfeK)8_soB&tY95ufU#^G~ z6L+B#f7Cr7?w2vN*(8TG*$^5q;Z9Yjm!3LJB?Yi*xD>hy zI2XdlT!-9MJnTK-gN5~lU%to7cci*zxYaaQjR*8K)k`$l7a4|s3AQLcI|%Q`rDF;f zZYlbZ1;`bSGLG7FH|OrJ-Ctu_d(3Cdewm=lcY#k?#xU8c4cGQOdGM9l`7SP_% zx}|hJw$m@I*3D0!OI%8!@Z5L9va4lkRWgS-(oUAEew{witJT&`1QEnq~g!qkkc5zOT2qQ zW%ZB)>G}+AM#Ag$%Ga&$TOYPafgx*^ox%p5m!vLLsZZVynb@4!{FX#LhX;xxLe zFS?KW@MUw!z%;(pO5{)XAm`uv>rqcqpX3`~aD{>@NLr2&Cfn-eVq030#q%{;WyGd)W>6-))RojfLnE-R?X7*h zjj|N8>Z$AVTqw>9ZmUW8c{@h>^3935#sJ;v=&&S)^PI18USG1NS%d{^1vdQXmoFKG z&>+|OHcAg$_L}9IOUQj74+Q^Q@_p!=;5+`Kpmefs--lGV;)^)~efClxB~swqt5`1F|P=j|6ql zZr zT{ORkUa{Qt>gYn{Z;E@*}?Y3@`DwxtmU(7nC7eoo4vT%f1>Ul zOuKf?sS5|l-qX-9Unl&QL*B8h*_ysyYF({or_Xw))!KCT+V4v{{riK8cizQDJXH@# z+;-e`UqSx#XPxkw^bd*LhN)!k#P5<;6TcNyc4@s3F|{`}-aW>Yy0$B6rU`2WT2>=F+p^g?>r7bVP#N(J2SHwrEv099nS8Pk% zD@`%eI0L?n@bI!Ju*fwkl|njnCvJ+FN0{$K!^ZA9ZnLeCr2aDAE4QyW6m8vq@9OEO zd7Vm)-Hg3j!MVrcnv6sq-*GP6Lz+Bi4;zMW-}l;_{!RPb@mM0{U|YFA#u-J#=Cl@H zxe^rod)MJZ=P2$}{QYC8`&*{TuQOeLosCWq5Hn#r5_`up*w;{_#o{t!{S?ej4Z4YY zlp1%6qQe%yB~`)-QjJfiBI&P}X2!n-at>A2GO>xSQrC|#J#1MMH8FT7(A}yD+THY7 z9d|!`9Gz`w_Ru6rtEdY4rgo~v#KdaF^|T^g_pl5s+b}1k+5;@>Ja%$%sb2M+KV*Wn zubjjLBkx(1y@@=k*^`+6Pt2>UnzQ$ zCeeWJ?XJ3zYLnqG*Ljaz_pT!~n`GJ^1OG|>nLA4yJM0$iVRE{0fWiMmrMT__~S(UrRab>Oa`VPqo9CRfFWRt2zmHl zK*G-LXH1I6_e#p{VpX z@dt|*ln(IyNwmQFdfPbwZSO!I++DX*X5LsA2Rq!4*{=k;EylH zlM_Xb*5^wZBz+F-{p+zn;l+i8o~(gKLbo?{Pp)q`*R}4^qZcchHTb#|^qQR6bJ@i& zu61k|3%Q^av82~9bJDY&&#i3MZ)@(Fz+GOccYbGk@j2f+a}%|GKRVXAU&*8I$&5J( zhkRIs6+03>>T(Cno$Z+Rpl^3`dcgtSJF?RQ1dN=E1S}+{-Pdtvh+MGq+thbyulJih z?`BognrzK;XU@B{?&r(nAN$>Tw_9pQ*v=y_?qxdM**39*j+_eNSJ{kkqeEm)s!b$P;!ebe@@h!Oz2Y@AIgrYg=-Ov0iQ{U(5FS zs!_a^t(EfUoIf*?eV+f=Q`c3NFVrfS_36c_yoQ8DasQ6JY1Gu(dH70~Q{3a=I?<0E z%2(SvGB!_>;TCI7DH4$}Hr)7Jph&PrdS}6rkUXn2M#YxhpJRFNEc$da!RgtPZ@rgx z|K!=uA!d93WW&;%6Xq1HJhGnq#4Jvmg%)AU0&et+up2*Le<3oO!DU^|obCMY9;&G{ zI!|(8o_st!y|#SY|E)j$r}9+y&Rkf>Y|j`ky>P$k(avmO%&V5TMwBEMr6!i7>ZSk* z1|tIlOI<@lT|=`FBO@zA3oAo&T?2C~1A}OWe+OY2Kq{>ux_}xC4Rj5F8Vo}W%&bg} ztqe>c8W;sP<)LWE%}>cptHiCLz=!J+P(u>PNj{m$sd>ez3>hUQ1y=g{V7oHQQj_y@ zbMy0x_413-^>ZLfiuIE!^^Nrm^cC`p6o^!Aq-Uz%-DZ;ta~{NH@BlE=H89pSGzu{? zv@$ib0(lP<0H?Qn_yW`*336U=ep*R+Vo@rCV@iHfs)A>3VtQ&&YGO)d;mK4Rpdx9A zqSB(|R0cOkUkFkN&dkYH@Jt4Jps6b5H&B@|LRoxhkPpna<>lpiX^FWIqzCk~eokVN dekMqxelgGt{X<81d4bv)JYD@<);T3K0RVitj@tkL diff --git a/WPFCatalog/Icons/picture.png b/WPFCatalog/Icons/picture.png deleted file mode 100644 index b773744c72df584d44d74ae66da69639b820ba19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1075 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(^vlDyqr zfHV;NblzPLq&N#aB8!2v2N=7Z%(epwmK8Xr18J~%3^B*n9%f)*{OIZ87-DgH>15mN z5J!==`NrSx?fsr6UZyC0*lm#t<3Xj4l|BC$xw)lRFWE5R3!`*>%YH|n^o3JfBP9Mi zI&9!*=~(cryC%nM_M1C%Et3T|r<{RzJq$VV6zLro8-Y zCtH?zQcHO8?I)hX;#2k>p0hqXwCzxCQd{M}6sGk`dj+}JkGV)R9?CHaysxHPyF4@6 z;(f>EDJMU&-M@DFidSg}y9qKGt3ES;>8*6da~>Bb-5cZ`QB9g2E4{?W4!o3=8v zPVwI461N?Orv9qg4?=(ET)ckp)jOs*(eDj*nwS9 z;lSaUNAEeC)E+3To}TlV`|EG+Gp?TVjn9|#Fg_95|7%a%`Rp6NuBg_@2pD=V0XnSQ z?S113`4EfU;*;iTcPMk(I%rNa&!2uhom+m{|8&d8972b)8Fs$1`p?Fee`_*x?ty*4 zl%QJT8c~v5l$uzQs+$5N7>o=IEOiYHbq&ozjEt-dEvyX9bq&m|3=EwgR%j8iFPNj{m$sd>ez z3>hUQ1y=g{V7oHQQj_y@bMy0x_413-^>ZLfiuIE!^^Nrm^cC`p6o^!Aq-Uz%-DZ;t za~{NH@BlE=H89pSGzu{?v@$ibGBkns$Nu+~=RggTAm;_=r9C%$#fm&t#wnnyONM1C<#gl*NYz`M`Wz sUS6)3mY54cdO$zx=OiZSXM!~97X!`EKXinb7pR@V)78&qol`;+06No>>Hq)$ diff --git a/WPFCatalog/MainWindow.xaml b/WPFCatalog/MainWindow.xaml deleted file mode 100644 index c7cd8fe..0000000 --- a/WPFCatalog/MainWindow.xaml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/imagecatalog/ImageCatalog 2 - Backup.csproj b/imagecatalog/ImageCatalog 2 - Backup.csproj deleted file mode 100644 index c77aca9..0000000 --- a/imagecatalog/ImageCatalog 2 - Backup.csproj +++ /dev/null @@ -1,59 +0,0 @@ - - - WinExe - net8.0-windows - enable - enable - true - False - 3.0.0.0 - 3.0.0.0 - 3.0.0-alpha.63+Branch.develop.Sha.39a9baf5c618d8d79c75b89e2d5c4020939697f2 - 3.0.0-alpha0063 - - - true - - - embedded - - - embedded - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - - - - - - - all - - - All - - - - - True - True - Settings.settings - - - - \ No newline at end of file diff --git a/imagecatalog/ImageCatalog 2.csproj b/imagecatalog/ImageCatalog 2.csproj index 36ac938..be6394f 100644 --- a/imagecatalog/ImageCatalog 2.csproj +++ b/imagecatalog/ImageCatalog 2.csproj @@ -51,17 +51,18 @@ - + + - - - - + + + + all diff --git a/imagecatalog/ImageCatalog 2.vbproj b/imagecatalog/ImageCatalog 2.vbproj deleted file mode 100644 index b8cc359..0000000 --- a/imagecatalog/ImageCatalog 2.vbproj +++ /dev/null @@ -1,347 +0,0 @@ - - - - Local - 9.0.30729 - 2.0 - {8D3AA2B0-8F06-4A61-9CAD-B920EB1A8E9C} - Debug - AnyCPU - - - - - ImageCatalog - - - None - JScript - Grid - IE50 - false - WinExe - Binary - On - On - ImageCatalog - ImageCatalog.My.MyApplication - - - WindowsForms - 3.5 - - - v4.7.2 - true - My Project\app.manifest - - - SAK - SAK - SAK - SAK - - - http://localhost/ImageCatalog/ - true - Web - true - Foreground - 7 - Days - false - false - true - 0 - 1.8.0.%2a - false - true - - - bin\ - ImageCatalog.xml - 285212672 - - - - - true - true - true - false - false - false - false - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - full - AnyCPU - AllRules.ruleset - false - - - bin\ - ImageCatalog.xml - 285212672 - - - - - false - true - false - true - false - false - false - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - none - AnyCPU - AllRules.ruleset - false - - - true - true - true - bin\x64\Debug\ - 285212672 - ImageCatalog.xml - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - full - x64 - AllRules.ruleset - false - - - true - bin\x64\Release\ - 285212672 - ImageCatalog.xml - true - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - x64 - AllRules.ruleset - false - - - true - true - true - bin\x86\Debug\ - 285212672 - ImageCatalog.xml - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - full - x86 - bin\ImageCatalog.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.vb - AllRules.ruleset - ;F:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;F:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - false - false - - - true - bin\x86\Release\ - 285212672 - ImageCatalog.xml - true - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - x86 - bin\ImageCatalog.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.vb - AllRules.ruleset - ;F:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;F:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - false - - - - ..\packages\Ben.Demystifier.0.3.0\lib\net45\Ben.Demystifier.dll - - - - System - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\packages\System.Collections.Immutable.5.0.0\lib\net461\System.Collections.Immutable.dll - - - 3.5 - True - - - System.Data - True - - - System.Drawing - True - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Reflection.Metadata.5.0.0\lib\net461\System.Reflection.Metadata.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll - - - System.Windows.Forms - - - System.XML - - - - - - - - - - - - - - - Code - - - - - - Code - - - Form - - - - MainForm.vb - - - Form - - - - True - Application.myapp - - - True - True - Settings.settings - - - - - Code - - - Code - - - Form1.vb - Designer - - - MainForm.vb - - - MyApplicationCodeGenerator - Application.Designer.vb - - - - - - My - SettingsSingleFileGenerator - Settings.Designer.vb - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - false - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - true - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - - - - {44465926-240d-473f-90b8-786ba4384406} - CatalogVbLib - - - {aebfe9e3-277c-4a7b-8448-145d1b11998b} - MaddoShared - - - - - - - - - - - - - - - - \ No newline at end of file From b29cc95a1e58c93565620a88cfc28c985c891bb4 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sun, 8 Mar 2026 13:44:09 +0100 Subject: [PATCH 34/69] feat: Enhance Avalonia UI with compact styles and improved layout for various views; adjust margins and paddings for a denser interface --- imagecatalog/AvaloniaApp.axaml | 46 +++++++++++++++++++ imagecatalog/AvaloniaMainWindow.axaml | 34 +++++++------- imagecatalog/AvaloniaViews/AiTabView.axaml | 24 +++++----- .../AvaloniaViews/FaceAiTabView.axaml | 22 ++++----- .../AvaloniaViews/GeneralTabView.axaml | 36 +++++++-------- imagecatalog/AvaloniaViews/LogoTabView.axaml | 26 +++++------ imagecatalog/AvaloniaViews/PhotoTabView.axaml | 18 ++++---- .../AvaloniaViews/RaceUploadTabView.axaml | 11 ++--- imagecatalog/AvaloniaViews/TextTabView.axaml | 34 +++++++------- .../AvaloniaViews/ThumbnailsTabView.axaml | 16 +++---- 10 files changed, 156 insertions(+), 111 deletions(-) diff --git a/imagecatalog/AvaloniaApp.axaml b/imagecatalog/AvaloniaApp.axaml index e4a021d..fe06efa 100644 --- a/imagecatalog/AvaloniaApp.axaml +++ b/imagecatalog/AvaloniaApp.axaml @@ -4,6 +4,52 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/imagecatalog/AvaloniaMainWindow.axaml b/imagecatalog/AvaloniaMainWindow.axaml index e9f6ef2..bd8498f 100644 --- a/imagecatalog/AvaloniaMainWindow.axaml +++ b/imagecatalog/AvaloniaMainWindow.axaml @@ -10,17 +10,17 @@ - + - + - + @@ -30,7 +30,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -99,24 +99,24 @@ - + - + @@ -124,20 +124,20 @@ Command="{Binding ProcessImagesCommand}" IsEnabled="{Binding UiEnabled}"> - + - + diff --git a/imagecatalog/AvaloniaViews/AiTabView.axaml b/imagecatalog/AvaloniaViews/AiTabView.axaml index e9652d4..a5f6971 100644 --- a/imagecatalog/AvaloniaViews/AiTabView.axaml +++ b/imagecatalog/AvaloniaViews/AiTabView.axaml @@ -3,33 +3,33 @@ xmlns:avaloniaDataGrid="clr-namespace:Avalonia.Controls;assembly=Avalonia.Controls.DataGrid" x:Class="ImageCatalog_2.AvaloniaViews.AiTabView"> - + - + - - + + -