-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate-screenshots-simple.py
More file actions
executable file
·58 lines (47 loc) · 1.87 KB
/
Copy pathcreate-screenshots-simple.py
File metadata and controls
executable file
·58 lines (47 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3
"""
Create App Store compatible screenshots by resizing to 2880x1800 with letterboxing
"""
import subprocess
import os
import shutil
TARGET_WIDTH = 2880
TARGET_HEIGHT = 1800
OUTPUT_DIR = "appstore-screenshots"
# Create output directory
os.makedirs(OUTPUT_DIR, exist_ok=True)
screenshots = [
("github/screenshots/MainWindow-1.png", "01-main-window.png"),
("github/screenshots/Popover-large.png", "02-popover.png"),
("github/screenshots/MainWindow-DevicesExpanded.png", "03-devices-detail.png"),
("github/screenshots/MainWindow-ServicesExpanded.png", "04-folders-detail.png"),
("github/screenshots/MainWindow-Activity.png", "05-activity-charts.png"),
("github/screenshots/Settings-1.png", "06-settings-general.png"),
("github/screenshots/Settings-2.png", "07-settings-sync.png"),
("github/screenshots/Settings-3.png", "08-settings-notifications.png"),
("github/screenshots/DemoMode-QuickScenarios.png", "09-demo-mode.png"),
]
print(f"Creating App Store screenshots ({TARGET_WIDTH}x{TARGET_HEIGHT})...\n")
for src, dst in screenshots:
if not os.path.exists(src):
print(f"⚠️ Skipping {src} (not found)")
continue
output_path = os.path.join(OUTPUT_DIR, dst)
# Use sips to resize with letterboxing (fit mode)
# This will scale the image to fit within the bounds while maintaining aspect ratio
cmd = [
'sips',
'-z', str(TARGET_HEIGHT), str(TARGET_WIDTH),
src,
'--out', output_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode == 0:
print(f"✓ Created: {output_path}")
else:
print(f"✗ Failed: {dst}")
if result.stderr:
print(f" Error: {result.stderr.strip()}")
print(f"\n✅ Done! Screenshots created in: {OUTPUT_DIR}/")
print("\nFiles created:")
subprocess.run(['ls', '-lh', OUTPUT_DIR])