Reads a stag CSV, orders the geotagged rows by their parsed
timestamp (ISO and EXIF-colon forms sort together), and draws the
trip on an OSM map: blue line with white halo, direction arrowhead
per leg, red marker per stop, MM-DD HH:MM label per timestamped
stop. Rows without a timestamp go last in CSV order; rows without
coordinates are skipped. Reuses sgeo tile/zoom/marker code via
shared fetch_tiles/draw_attribution helpers. Tests: 11/11 in
tests/run_tests.sh (3 new trip cases + tests/check_trip.py).
Docs: docs/trip-path.md.
- sfile --json: one JSON object per file (JSON Lines) carrying format,
offsets, decoded fields and geotags when present; default CLI
output byte-identical (verified against the pre-refactor binary).
- libsfile: src/sfile.h + src/sfile_lib.c expose the decoder
(sfile_decode_file/mem, sfile_result_to_json, format table
introspection); make lib builds libsfile.a and libsfile.so.1.1.0,
make install installs them plus the header.
- tests/test_json.py: JSON parses and matches the text table on the
same files (make test-json); tests/test_library.c + test_lib.sh:
static and shared link test (make test-lib).
Remove the stale caveat that make fails without src/geotag.c.
Plain make builds sfile (and scar); make stag sgeo stays the
minimal build for the geotag tools.
- docs/stag-sgeo.md: building (make stag sgeo; make all blocked on
uncommitted src/geotag.c), sfile lookup order, media-extension scan
set, CSV columns + empty-coords rule, real stag/sgeo output against
the decoder build of sfile (SF/Tokyo EXIF GPS), OSM attribution and
the runtime tile-fetch dependency, test suite (8/8).
- README.md: stag/sgeo section + Layout/Building entries.
Real-file test against the /opt/sfile decoders showed the decoder
normalises EXIF GPSDateStamp to dashes (geotag.c: EXIF stores the
date as YYYY:MM:DD; normalised to ISO YYYY-MM-DD so the field is
machine-parseable). The contract example/table said YYYY:MM:DD.
Fixed the doc, and the fake sfile + expected CSV to match the real
decoder output (the nyc fallback case still exercises the colon
form via GPSDateStamp).
tests/run_tests.sh: fake sfile on PATH (tests/bin/sfile, canned GPS
values in section + EXIF tag-name forms), a local tile server
(tests/tile_server.py, $SGEO_TILE_BASE) so sgeo tests run offline,
and tests/check_map.py (stdlib PNG decode: marker-cluster count +
attribution plaque). Cases: multi-file CSV byte-for-byte, multi +
single-point maps, no-geotag dir, empty dir, default outfiles.
8 checks, all passing.
docs/geotag-contract.md: the field-name contract between the
decoder (what sfile prints in its Geotagging: section) and the
client parser (section + EXIF tag-name / uniform-table fallback
forms it accepts), incl. first-source-wins, defaults, and ranges.
Note: tests/bin/sfile is force-added -- .gitignore has a bare
sfile rule for the built binary.
sgeo [dir] [outfile] collects media files, extracts geotags via the
client seam, and plots one red marker per geotagged file on a map
stitched from tile.openstreetmap.org tiles (libcurl at runtime,
libpng stitching). Zoom is computed from the points bounding box
(single point, or coincident points, use zoom 15); the tile count
is capped by zooming out. Attribution (C) OpenStreetMap
contributors is drawn ON the image with a self-contained 5x7 bitmap
font -- no ImageMagick at runtime. $SGEO_TILE_BASE overrides the
tile source (for tests). With no geotagged files sgeo prints a
message to stderr, exits non-zero, and writes no output file.
stag [dir] [outfile] collects media files (non-recursive), runs sfile
on each via the geotag client seam (src/geotag_client.c, $SFILE/PATH/
alongside-executable lookup) and writes one CSV row per file:
file,format,latitude,longitude,altitude,datum,timestamp,source.
Files with no geotag still get a row, with the geotag fields empty.
Also fixes a typo in the seam that broke the build: strrchr(self, /)
was missing its quotes (must be strrchr(self, /)).
Makefile: new stag target (links geotag_client.c, -lm); all still
builds just sfile.
Scan a raw disk image for sfiles known magics (831 formats) and carve
out the files: PNG chunk walk, JPEG marker walk, GIF block walk, ZIP
local-header walk + EOCD, PDF %%EOF scan, gzip inflate sizing; next-
header/EOF fallback with a size cap for the rest. Report lists offset,
format, size, confidence and how the end was found.
- src/scar.c, src/footers.h: carver + footer/trailer table
- Makefile: scar target (links -lz), test-scar target, install both
- tests/test_scar.py: synthetic image, 7 files recovered byte-identical
- docs/scar.md: usage, real example output, decisions, limits
Triaged all 136 PARTIALs in 5 batches; 39 had a real fixed layout and
were converted to PASS via hand overrides (351 total): LNK, NDS (CRC-16
verified), MXF header partition packs, ADX, ASF, BLEND, CDF, CPIO (old
binary), registry-hive DAT, FAT12 boot sectors, J2K SOC+SIZ, JP2 prefix,
PAR2, DEGAS PI2, MS-PST, RBXL, MPQ, SDS, VMDK, VPK, WMF, WMV, WUHB,
and 16 more. The other 97 are inherently partial (text 46, variable-
length 15, streaming 9, no-spec 9, chunk-scanning 8, no-header 7,
EBML 3) and are documented by category in the README; verdicts in
tools/triage_partial_B*.json. Regression fix: 814 .WMA got the ASF GUID
magic so the shared GUID disambiguates to .WMA by extension (it had
been stolen to .ASF when 39/817 gained the magic).
Re-tried page links (bulk_fetch): 21 genuine new samples (14 PASS, 7 PARTIAL).
Web search: 3 more (293 .hta, 634 .sass, 720 .tb2). Dropped 10 bogus
bulk_fetch samples (page links pointed at PDFs/unrelated ZIPs/gzip/7z/404)
and recorded the bad URLs in tools/bad_page_urls.json so they are not
re-fetched. Doubtful samples: 550/554 kept, 005 (3GPP not 3GPP2) /
024 (explanatory text) / 373 (truncated at 50 MiB cap) dropped, 166
magic fixed Pin -> [IBIS Ver]. 298 renamed .ics->.ical, 733 bogus PDF
dropped. Only FAILs left are the duplicates 312/520.
Batch overrides for the mis-identified samples: ZIP/PK, RIFF, XML,
ELF, OLE, Ogg, MZ, bzip2, xz, TAR, J2C, MDMP, FCS, ftyp, EMF magics;
CDR 81/82 magic swap; DNG to big-endian TIFF; CUBE/EMAKER text;
FREQ ext .frq; SF ext .sf2; VSQ ext .VSQ + MIDI layout.
298 sample renamed .ics->.ical (task is .ICAL); 733 bogus PDF
sample dropped (tmp has no defined format).
Remaining FAILs are the two known unresolvable duplicates 312/520.
200 (.exs) is PARTIAL: reference block is a placeholder, no layout.
Rounds 13-14 of the autonomous driver crashed in load_manifests
('list' object has no attribute 'items') on the 1-215 collector's
list-shaped manifest shard, so the driver re-reported the round-12
counts (537/109/31/172) and stopped on the apparent plateau. The
harness now normalizes list shards (entries carry a 'task' key).
Clean full re-run with all four collectors finished: 750 sample
files on disk, 561 PASS / 130 PARTIAL / 38 FAIL / 124 NO SAMPLE
of 853 counted (849 formats + 4 no-page task numbers).
Runs the loop with no agent intervention: regenerate table, rebuild,
test, count PASS/PARTIAL/FAIL/NO SAMPLE, retry-fetch missing samples
when the collectors are quiescent, commit each round, write
LOOP_STATUS after every round, log to loop.log. Stops when NO SAMPLE
stops decreasing for 2 rounds, PASS plateaus for 2 rounds, or after
15 rounds. Final plain push to github (no --force).
- 647 SD7 is a renamed 7z (Spring RTS); .SC7 was a bad extraction
- Fixed batch-8 clobber of 106's text marking; harness counts a 1-field
header table as decoded (DWF)
- Freed /tmp (deleted stale lzply-clone2/demo8) after a build failed with
'No space left on device' — the running sample collectors stage large
downloads in /tmp
- All 849 formats in the table (831 with code + 18 no-code tasks)
- Container-layout inheritance: ZIP/RIFF/ftyp/Ogg fixed headers shared
by formats using those containers (37 formats)
- Curated magic extended by container family (ZIP/OLE/RIFF/XML/TIFF/
PE/ELF); ftyp+brand magics for 3G2/3GP/3GX/MOV; bogus magics removed
(LMD 'FCS3.1', CLS '# ', REXX '/*', FCS '$NEXTDATA=')
- FODP/FODS/FODT corrected to flat XML (not ZIP)
- ACCDB: JET/ACE 'Standard ACE DB' magic beats the TTF collision
- Test on real samples: 40 PASS / 21 PARTIAL / 4 FAIL (the 4 FAILs are
wrong samples: FNA is a gzip, NDS is a ZIP, NEU/SNO are PDFs)