Add more debug logging for stego file tracking

Log stego file size and hash at:
- Encode result storage
- Download time

This will help identify if files are corrupted during
download/upload cycle.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Aaron D. Lee
2026-01-04 20:47:12 -05:00
parent 038fd6ceac
commit 5501c7e0ba

View File

@@ -1018,6 +1018,8 @@ def encode_page():
# Store temporarily
file_id = secrets.token_urlsafe(16)
cleanup_temp_files()
stego_hash = hashlib.md5(encode_result.stego_data).hexdigest()[:8]
print(f"[ENCODE RESULT] stego: {len(encode_result.stego_data)} bytes, md5: {stego_hash}", file=sys.stderr)
TEMP_FILES[file_id] = {
"data": encode_result.stego_data,
"filename": filename,
@@ -1099,6 +1101,9 @@ def encode_download(file_id):
file_info = TEMP_FILES[file_id]
mime_type = file_info.get("mime_type", "image/png")
download_hash = hashlib.md5(file_info["data"]).hexdigest()[:8]
print(f"[DOWNLOAD] stego: {len(file_info['data'])} bytes, md5: {download_hash}", file=sys.stderr)
return send_file(
io.BytesIO(file_info["data"]),
mimetype=mime_type,