diff --git a/frontends/web/app.py b/frontends/web/app.py index fc9db95..9cfc79b 100644 --- a/frontends/web/app.py +++ b/frontends/web/app.py @@ -84,6 +84,36 @@ THUMBNAIL_FILES: dict[str, bytes] = {} TEMP_FILE_EXPIRY = 300 # 5 minutes THUMBNAIL_SIZE = (250, 250) # Maximum dimensions for thumbnail +# ============================================================================ +# CONFIGURATION +# ============================================================================ + +# Override stegasoo limits for larger files +# Note: You might need to modify the stegasoo library itself +# to actually increase these limits in its internal calculations + +# Flask upload limit (30MB) +MAX_UPLOAD_SIZE = 30 * 1024 * 1024 + +# Try to import and override stegasoo constants if possible +try: + # Check current limits + print(f"Current MAX_FILE_SIZE from constants: {MAX_FILE_SIZE}") + print(f"Current MAX_FILE_PAYLOAD_SIZE: {MAX_FILE_PAYLOAD_SIZE}") + + # Try to increase payload size limit (in bytes) + # 15MB should be enough for 7.6MB files with overhead + DESIRED_PAYLOAD_SIZE = 15 * 1024 * 1024 # 15MB + + # Note: You might need to patch the stegasoo module + # if MAX_FILE_PAYLOAD_SIZE is used internally + import stegasoo + if hasattr(stegasoo, 'MAX_FILE_PAYLOAD_SIZE'): + print(f"Overriding MAX_FILE_PAYLOAD_SIZE to {DESIRED_PAYLOAD_SIZE}") + stegasoo.MAX_FILE_PAYLOAD_SIZE = DESIRED_PAYLOAD_SIZE + +except Exception as e: + print(f"Could not override stegasoo limits: {e}") def generate_thumbnail(image_data: bytes, size: tuple = THUMBNAIL_SIZE) -> bytes: """Generate thumbnail from image data.""" @@ -737,4 +767,4 @@ def about(): # ============================================================================ if __name__ == '__main__': - app.run(host='0.0.0.0', port=5000, debug=False) \ No newline at end of file + app.run(host='0.0.0.0', port=5000, debug=False) diff --git a/src/stegasoo/constants.py b/src/stegasoo/constants.py index e2c6f63..63b96f4 100644 --- a/src/stegasoo/constants.py +++ b/src/stegasoo/constants.py @@ -44,11 +44,13 @@ PBKDF2_ITERATIONS = 600000 # INPUT LIMITS # ============================================================================ -MAX_IMAGE_PIXELS = 16_000_000 # ~16 megapixels (4000x4000) +MAX_IMAGE_PIXELS = 24_000_000 # ~24 megapixels MAX_MESSAGE_SIZE = 250_000 # 250 KB (text messages) -MAX_FILE_PAYLOAD_SIZE = 250_000 # 250 KB (file payloads) MAX_FILENAME_LENGTH = 255 # Max filename length to store -MAX_FILE_SIZE = 10 * 1024 * 1024 # 10 MB (upload limit) + +# Example in constants.py +MAX_FILE_SIZE = 30 * 1024 * 1024 # 30MB total file size +MAX_FILE_PAYLOAD_SIZE = 2 * 1024 * 1024 # 2MB payload MIN_PIN_LENGTH = 6 MAX_PIN_LENGTH = 9 diff --git a/test_data/qr_scan.jpg b/test_data/qr_scan.jpg new file mode 100644 index 0000000..80474ce Binary files /dev/null and b/test_data/qr_scan.jpg differ