clipwright/clipwright/tools/verify_hooks.py
pedro-bento 1dec0dd1af
All checks were successful
CI / backend-tests (push) Successful in 28s
CI / frontend-build (push) Successful in 20s
chore/dead-code-removal (#4)
Reviewed-on: #4
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 22:11:11 +01:00

35 lines
1,023 B
Python

import os
from clipwright.media.hooks import create_hook_image
def verify():
print("🧪 Verifying Hook Image Generation...")
test_text = "POV: You are testing the viral hook feature\nand it works perfectly."
output_path = "test_hook.png"
target_width = 800
try:
path, w, h = create_hook_image(test_text, target_width, output_image_path=output_path)
print(f"✅ Image generated at {path}")
print(f" Dimensions: {w}x{h}")
if not os.path.exists(path):
print("❌ File does not exist")
return False
if os.path.getsize(path) == 0:
print("❌ File is empty")
return False
print("✨ Verification Successful!")
return True
except Exception as e:
print(f"❌ Verification Failed: {e}")
return False
finally:
if os.path.exists(output_path):
os.remove(output_path)
if __name__ == "__main__":
verify()