forked from kamilstanuch/Autocrop-vertical
-
Notifications
You must be signed in to change notification settings - Fork 423
Expand file tree
/
Copy pathverify_custom_hook.py
More file actions
32 lines (26 loc) · 938 Bytes
/
verify_custom_hook.py
File metadata and controls
32 lines (26 loc) · 938 Bytes
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
import os
try:
from hooks import create_hook_image
except ImportError:
print("⚠️ PIL not found locally. Run inside Docker.")
exit(1)
def verify():
print("🧪 Verifying Hook Customization...")
test_text = "Custom Position\n& Size Test"
# Test 1: Small + Top
print(" Testing Small + Top...")
p1, w1, h1 = create_hook_image(test_text, 800, "hook_small.png", font_scale=0.8)
print(f" ✅ Small: {w1}x{h1}")
# Test 2: Large + Center
print(" Testing Large...")
p2, w2, h2 = create_hook_image(test_text, 800, "hook_large.png", font_scale=1.3)
print(f" ✅ Large: {w2}x{h2}")
if w2 > w1 and h2 > h1:
print(" ✅ Scaling logic works (Large > Small)")
else:
print(" ❌ Scaling logic failed")
# Cleanup
if os.path.exists(p1): os.remove(p1)
if os.path.exists(p2): os.remove(p2)
if __name__ == "__main__":
verify()