From a7c2fcc1da349b3677a3206860af638883a93cfd Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Mon, 29 Dec 2025 23:01:12 -0500 Subject: [PATCH] Fixed container bugy nightmare (somehow). --- frontends/web/app.py | 13 ++++++++++++- src/stegasoo/__init__.py | 8 ++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/frontends/web/app.py b/frontends/web/app.py index 4eca60d..2a4f86c 100644 --- a/frontends/web/app.py +++ b/frontends/web/app.py @@ -686,7 +686,18 @@ def decode_page(): if not result.is_valid: flash(result.error_message, 'error') return render_template('decode.html', has_qrcode_read=HAS_QRCODE_READ) - + + with open('/tmp/debug_stego.png', 'wb') as f: + f.write(stego_data) + with open('/tmp/debug_ref.png', 'wb') as f: + f.write(ref_data) + with open('/tmp/debug_params.txt', 'w') as f: + f.write(f"day_phrase: {day_phrase}\n") + f.write(f"pin: {pin}\n") + f.write(f"date_str: {stego_date}\n") + f.write(f"rsa_key: {len(rsa_key_data) if rsa_key_data else None}\n") + + print(f"DEBUG: Saved inputs to /tmp/debug_*") # Decode decode_result = decode( stego_image=stego_data, diff --git a/src/stegasoo/__init__.py b/src/stegasoo/__init__.py index d5c4b50..7a2a3bf 100644 --- a/src/stegasoo/__init__.py +++ b/src/stegasoo/__init__.py @@ -388,6 +388,7 @@ def decode( pin: str = "", rsa_key_data: Optional[bytes] = None, rsa_password: Optional[str] = None, + date_str: Optional[str] = None, ) -> DecodeResult: """ Decode a secret message or file from a stego image. @@ -429,7 +430,9 @@ def decode( require_valid_rsa_key(rsa_key_data, rsa_password) # Try to extract with today's date first - date_str = date.today().isoformat() + # Use provided date or fall back to today + if date_str is None: + date_str = date.today().isoformat() pixel_key = derive_pixel_key( reference_photo, day_phrase, date_str, pin, rsa_key_data ) @@ -467,6 +470,7 @@ def decode_text( pin: str = "", rsa_key_data: Optional[bytes] = None, rsa_password: Optional[str] = None, + date_str: Optional[str] = None, ) -> str: """ Decode a text message from a stego image. @@ -614,4 +618,4 @@ __all__ = [ # Debugging 'debug', -] \ No newline at end of file +]