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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user