import base64
import os

source = r"C:\Users\ASUS\.gemini\antigravity\brain\69907928-efa2-41bd-997d-edfadc3e88d6\uploaded_image_1766891480063.jpg"
output = r"c:\xampp\htdocs\Imanoelci\public\b64.txt"

try:
    with open(source, "rb") as f:
        data = f.read()
        b64 = base64.b64encode(data).decode('utf-8')
        with open(output, "w") as out:
            out.write(b64)
        print(f"SUCCESS: Wrote {len(b64)} chars to {output}")
except Exception as e:
    with open(output, "w") as out:
        out.write(f"ERROR: {str(e)}")
    print(f"ERROR: {str(e)}")
