fix(archive): reject mislabelled .jpg before vips as corrupt source (BIT-31229) — land #94 on main #114

Merged
spark merged 3 commits from fix/BIT-31229-unsupported-image-format into main 2026-10-22 01:05:02 +01:00
Owner

Leva para o main a alteração do #94 (BIT-31229).

O #94 foi revisto, ficou com CI verde e foi feito merge, mas a base era fix/BIT-31621-moov-corrupt-source (PR empilhado sobre o #93) e não o main. Como o #93 já tinha entrado no main antes, o conteúdo do #94 ficou só nesse branch.

Este PR usa o mesmo branch do #94 (7a8cb44, já com o main atual) e não traz nada de novo: rejeitar .jpg com o formato errado antes do vips, como corrupt_source.

Leva para o `main` a alteração do #94 (BIT-31229). O #94 foi revisto, ficou com CI verde e foi feito merge, mas a base era `fix/BIT-31621-moov-corrupt-source` (PR empilhado sobre o #93) e não o `main`. Como o #93 já tinha entrado no `main` antes, o conteúdo do #94 ficou só nesse branch. Este PR usa o mesmo branch do #94 (`7a8cb44`, já com o `main` atual) e não traz nada de novo: rejeitar `.jpg` com o formato errado antes do vips, como `corrupt_source`.
spark added 3 commits 2026-10-22 00:54:59 +01:00
fix(archive): reject mislabelled .jpg before vips as corrupt source (BIT-31229)
ci / rust (pull_request) Failing after 23m46s
ci / typescript (pull_request) Failing after 24m30s
159a0909ed
A .jpg whose bytes are HEIC/RAW or an error body (not a real JPEG) makes
sharp/vips throw "Input file contains unsupported image format" /
VipsForeignLoad "is not a known file format". The image index path logged
that at warn, so every such file opened one error-hub ticket (3 duplicates
collapsed into BIT-31229).

Detect the format by magic bytes before calling vips: isDecodableImage
accepts JPEG/PNG/GIF/BMP/TIFF/WebP and rejects anything else, throwing
CorruptSource("unsupported_image_format"). The existing catch (BIT-31621)
marks it FAILED once at info and never reaches the error hub. Also extend
isCorruptSourceMessage to match sharp's unsupported-format wording, so a
decoder failure that slips past the magic bytes is still classified as
source damage.

Stacked on BIT-31621 (which introduced corrupt-source.ts and wired the
image/video catch blocks).

Paperclip-Issue: BIT-31229
Paperclip-Run: 8b98a125-c9b2-4c2f-b05a-b35054c9eb5b
This branch sits on #93. Merging the #93 branch after it took main brings in
#90, #91, #95 and the rest of main with no conflicts; the magic-byte check
before vips and the unsupported image format message stay as they were.
Merge main into fix/BIT-31229-unsupported-image-format
ci / rust (pull_request) Successful in 4m54s
ci / typescript (pull_request) Successful in 8m47s
7a8cb445c6
Member

@cto — Gitea autopilot needs a CTO decision on BitReport.pt/photoreport#114: CI is green but the PR has no official approval.

  • Head: 7a8cb445c62c
  • The bot did not approve or schedule a merge for this head.
  • Fix the branch, approve as CTO, or close the PR. The bot re-checks on the next run.
@cto — Gitea autopilot needs a CTO decision on BitReport.pt/photoreport#114: CI is green but the PR has no official approval. - Head: `7a8cb445c62c` - The bot did **not** approve or schedule a merge for this head. - Fix the branch, approve as CTO, or close the PR. The bot re-checks on the next run. <!-- gitea-autopilot-escalation kind=needs_official_approval sha=7a8cb445c62c -->
spark merged commit b844d58ea9 into main 2026-10-22 01:05:02 +01:00
Sign in to join this conversation.