Commit ddd0730
ftp-camera: make the ARW completeness check definitive, not pattern-matched
The first cut of the ARW branch matched exiftool output against
'truncat|corrupt|bad offset|bad format|missing.*end|premature'. Two of
those terms are dangerous: "bad format" and "corrupt" appear for benign
maker-note quirks in perfectly good Sony files. On a network where every
transfer is already struggling, rejecting every ARW would have been its
own outage — and a false "truncated" verdict is worse than useless
because it looks like evidence.
Replaced with a definitive test that runs first. ARW is TIFF: the IFDs
record where each data strip begins (StripOffsets) and how long it is
(StripByteCounts). If any strip is declared to end beyond the actual end
of file, bytes are provably missing. No judgement and no pattern
matching, and it cannot false-positive on a valid file, because a valid
file's strips are all inside it.
The exiftool-wording check remains only as a fallback, narrowed to
unambiguous truncation terms. Anything short of an explicit truncation
report now returns UNVERIFIED (2) rather than TRUNCATED (1), so an
ambiguous validator result never blocks a good RAW — it warns instead.
Tested the overflow arithmetic against strips that fit, strips that run
past EOF, and missing tags; all three classify correctly. The JPEG path
(SOI/EOI) remains the exact one and is unchanged.
Refs: CLAUDE/Plan/00066-ftp-camera-airbnb-wifi-and-hotspot-triage
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 2cbd580 commit ddd0730
1 file changed
Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
586 | 620 | | |
587 | 621 | | |
588 | | - | |
| 622 | + | |
589 | 623 | | |
590 | 624 | | |
591 | | - | |
| 625 | + | |
592 | 626 | | |
593 | 627 | | |
594 | 628 | | |
| |||
0 commit comments