- Spegnimento
- 24 settembre 2026 alle ore 23:16 UTC
- Autore
- Kamo
- Impegno
- f7729d9
A chat image attachment is drawn at most 240x240 CSS px and every viewer downloaded the original to do it — a phone photo is 3-8 MB. MediaService will store one preview per stored file (ImgDat) and serve it to chat bubbles; this is the cutter it calls. ImagePreviewService fits the long edge to 480 (2x the box), never upscales, and writes lossy WebP with no metadata. EXIF orientation is baked in (a portrait photo's preview would otherwise lie on its side next to its upright original), with ffmpeg's own autorotate off so no build can rotate twice. Vectors, animations (GIF, APNG, animated WebP), undecodable bytes, oversized sources and previews no smaller than the original are REFUSED — 422 with X-Preview-Refused, which the caller may remember. Busy/timeout/ffmpeg failure is 503 and says nothing about the image. Memory, after the logo ladder OOM-killed both pods: ffmpeg runs one at a time, single-threaded **************** 1), scales before rotating, and decodes a JPEG at 1/2^k in the IDCT (-lowres, keeping 2x the preview edge). Peak RSS measured with /usr/bin/time -f %M on the exact command: 12 MP JPEG 68 MB, 48 MP JPEG 123 MB, progressive 12 MP 92 MB, 16 MP PNG 115 MB (184 MB for pure noise). Ceilings: JPEG 52 MP, PNG/WebP/GIF 16.8 MP, source 40 MiB. Internal-only on the public-chat secret MediaService already presents to /transcribe; fails closed.
