perf(photo): stop re-reading the downloaded temp file

download_to_temp buffered the full bytes, wrote them to a temp file, and
prepare_photo then read the whole file back from disk. The bytes are
already in memory — pass them through (download_to_temp now returns
(file, bytes)) so photo processing never touches the disk for input.
Adds the bytes dependency to xmedia-bot (already in the lock via x-media).
This commit is contained in:
2026-08-13 22:24:58 +08:00
parent 505990e49e
commit 1747d321d8
4 changed files with 25 additions and 17 deletions
+1
View File
@@ -17,6 +17,7 @@ rusqlite = { version = "0.32", features = ["bundled"] }
rand = "0.8"
tempfile = "3"
parking_lot = "0.12"
bytes = "1"
png = "0.18"
zune-jpeg = "0.5"
fast_image_resize = "6"