Skip to content

Export image-based: keep the profile's Resolution (fix #12244)#12250

Merged
niksedk merged 1 commit into
mainfrom
fix/export-image-profile-resolution-12244
Jul 7, 2026
Merged

Export image-based: keep the profile's Resolution (fix #12244)#12250
niksedk merged 1 commit into
mainfrom
fix/export-image-profile-resolution-12244

Conversation

@niksedk

@niksedk niksedk commented Jul 7, 2026

Copy link
Copy Markdown
Member

Fixes #12244 — profiles in the "Export to … (Blu-ray sup)" dialog lost (or silently overwrote) their Resolution on reopen, while font size restored fine.

Root cause — two compounding defects

  1. LoadProfile matched resolution by Width only, against presets only. The save path writes both ScreenWidth and ScreenHeight, but the load matched Resolutions.FirstOrDefault(r => r.Width == profile.ScreenWidth). A profile's custom resolution (UHD 3840×1920) has no preset with that height, so it snapped to the same-width preset (3840×2160) or, with no width match, to the 1920×1080 default. Font size round-trips by exact value — hence only the resolution seemed to "reset".

  2. Initialize force-selected the loaded video's resolution after the profile was applied. ExportBluRaySup passes the main window's video in, and Initialize asynchronously set SelectedResolution to the video's size, overriding the profile. Because SaveProfile runs on close, the video's size was then written back into the selected profile — corrupting it. This is what made the reporter's UHD profile display the HD source video's 1920×960.

Fix

  • Add EnsureResolutionItem(width, height) — matches on both dimensions and materialises a custom ResolutionItem (just below the "pick from video" entry) when the exact size isn't a preset, so any resolution round-trips.
  • LoadProfile uses it, so custom resolutions restore exactly.
  • Initialize now only makes the video's resolution available in the combo and falls back to it only when the profile left no valid resolution selected (SelectedResolution ??= item instead of overwrite). A profile with a resolution always wins; the video can still be picked manually.

Verification

Standalone harness reproducing the reported setup (HD 1920×960 + UHD 3840×1920 profiles, presets-only list, a loaded HD video) — 8/8 checks pass:

  • UHD reopens as 3840×1920 (not the 3840×2160 preset);
  • a loaded 1920×960 video does not override the UHD profile;
  • the profile is still 3840×1920 after save-on-close (no corruption);
  • a custom 1920×960 doesn't get shadowed by the 1920×1080 preset;
  • in-session profile switching round-trips;
  • standard presets and the video-as-fallback (when a profile has no resolution) still work.

Built the UI project clean. Not driven through the live GUI, but the affected logic is covered by the harness above.

🤖 Generated with Claude Code

…eopen)

Profiles in the "Export to ... (Blu-ray sup)" dialog stored a resolution
that was silently lost - and often overwritten - on reopen (#12244).

Two defects compounded:

1. LoadProfile matched the resolution combo by Width ONLY, against the
   static preset list. A profile's custom resolution (e.g. UHD 3840x1920)
   has no matching preset height, so it snapped to a same-width preset
   (3840x2160) or, with no width match, to the 1920x1080 default. Font
   size round-tripped by exact value, so only the resolution appeared to
   "reset".

2. Initialize force-selected the loaded video's resolution AFTER the
   profile was applied, so opening the export with a video loaded replaced
   the profile's resolution with the video's - and, because SaveProfile
   runs on close, wrote the video's size back into the selected profile,
   corrupting it. This is what made the reporter's UHD profile show the
   HD source video's 1920x960.

Fix: add EnsureResolutionItem(width, height) that matches on BOTH
dimensions and materialises a custom item when the exact size isn't a
preset, so any resolution round-trips. LoadProfile uses it; Initialize now
only makes the video's resolution available and falls back to it solely
when the profile left no valid resolution selected (?? instead of
overwrite).

Verified via a standalone harness: UHD custom resolution survives reopen
with an HD video loaded, is not corrupted on save-on-close, same-width
custom heights don't shadow presets, in-session profile switching
round-trips, and standard presets plus the video-fallback still work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@niksedk niksedk merged commit 35d94af into main Jul 7, 2026
2 of 3 checks passed
@niksedk niksedk deleted the fix/export-image-profile-resolution-12244 branch July 7, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile in Export to ... (... Blu-ray sup) does not save Resolution

1 participant