fix: scale random portrait count — 1 per 3 clips (e.g. 2 for 6 clips)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-11 23:39:42 +02:00
parent 439bc85505
commit ffb99d3e66
+8 -6
View File
@@ -1684,13 +1684,15 @@ class MainWindow(QMainWindow):
out = build_export_path(folder, name, self._export_counter, sub=sub) out = build_export_path(folder, name, self._export_counter, sub=sub)
jobs.append((start, out, base_ratio, base_center)) jobs.append((start, out, base_ratio, base_center))
# Random portrait: pick one clip, give it a random ratio + position # Random portrait: ~1 per 3 clips gets a random ratio + position
if self._chk_rand_portrait.isChecked() and n_clips > 1: if self._chk_rand_portrait.isChecked() and n_clips > 1:
idx = random.randrange(n_clips) n_portrait = max(1, n_clips // 3)
rand_ratio = random.choice(list(_RATIOS.keys())) indices = random.sample(range(n_clips), n_portrait)
rand_center = random.random() for idx in indices:
s, o, _, _ = jobs[idx] rand_ratio = random.choice(list(_RATIOS.keys()))
jobs[idx] = (s, o, rand_ratio, rand_center) rand_center = random.random()
s, o, _, _ = jobs[idx]
jobs[idx] = (s, o, rand_ratio, rand_center)
raw = self._txt_resize.text().strip() raw = self._txt_resize.text().strip()
try: try: