Skip to content

Add media-info-wdx: media-metadata content plugin (WDX)#11

Merged
NikolaiSachok merged 2 commits into
mainfrom
media-info-wdx
Jun 24, 2026
Merged

Add media-info-wdx: media-metadata content plugin (WDX)#11
NikolaiSachok merged 2 commits into
mainfrom
media-info-wdx

Conversation

@NikolaiSachok

Copy link
Copy Markdown
Owner

What & why

Adds media-info-wdx, a native macOS Double Commander WDX content plugin that surfaces per-file media metadata as custom-column / tooltip fields — so image & video resolution, audio & video duration, and PDF page count are visible right in the file listing. This fills a real gap: the bundled MacPreview/QuickLook previews images but never shows pixel dimensions, and DC ships no image/video content plugin on macOS.

Motivated by a concrete friction (needing image resolution without dropping to XnView), generalized to a single adaptive column across media types.

Changes

  • New plugin media-info-wdx/ (source, ABI header, build/install/registrar, real-artifact test harness, README, third-party manifest).
  • Fields: adaptive Summary (image→W × H, video→W × H · m:ss, audio→m:ss, pdf→N pages) plus Dimensions, Width, Height, Megapixels, DPI, Bit depth, Duration (+ sortable seconds), Frame rate, Bitrate, Sample rate, Channels, Video/Audio codec, Page count, Plugin version. Empty for non-applicable files, so one column serves every type.
  • Backends are all macOS system frameworks — ImageIO (header reads), AVFoundation, CoreGraphics/CGPDF. No third-party libraries, no network. AVI is read with a self-contained RIFF avih parser (AVFoundation can't open AVI on macOS).
  • Root README table + layout, CHANGELOG, CI (build + headless harness), release workflow (media-info-wdx-v*), and the pre-commit hook all extended for the new plugin.

Two host-dependent bugs found & fixed during live testing in real DC

  1. Crash ("Access violation") browsing folders of camera JPEGs. Root-caused deterministically: DC is a Lazarus/FPC app that enables FP-exception traps; ImageIO's RAW/MakerNote path does FP math that's harmless when masked but fatal under FPC. Fix: mask FP exceptions around every framework call and restore the host environment. (Same "verify in the real host, not a mock" lesson as the markdown-wlx Escape fix.)
  2. AVI showed no data. DC gates content-plugin calls by the DetectString registered in doublecmd.xml; register_plugin.py was missing AVI (a substring check had been fooled by AVIF). Fix: add AVI to the registrar and verify the exact (EXT="AVI") clause.

Verification

  • ./build.sh → universal (arm64 + x86_64), ad-hoc signed; all 6 WDX exports present
  • Real-artifact harness dlopens the built .wdx and asserts field values on a synthesized PNG/PDF/WAV/AVI, the CONTENT_DELAYIFSLOW deferral protocol, and survival under FPC-style FP-exception traps — 26/26 PASS (CI runs it headlessly)
  • bash scripts/leak-guard.sh clean
  • Tested live in Double Commander: image/PDF/MP4/AVI columns populate; the crash folder (346 files) no longer crashes
  • /code-review run by a fresh reviewer (not the author): no Critical/High; one Low contract nit (numeric return when buffer too small) fixed in a follow-up commit

🤖 Generated with Claude Code

NikolaiSachok and others added 2 commits June 24, 2026 21:19
A native Double Commander WDX content plugin that surfaces per-file media
metadata as custom-column / tooltip fields, so image/video resolution, audio/
video duration, and PDF page count are visible directly in the file listing
(filling a gap: the bundled MacPreview/QuickLook never shows pixel dimensions).

- Fields: adaptive Summary plus Dimensions, Width, Height, Megapixels, DPI, bit
  depth, Duration (+ sortable seconds), frame rate, bitrate, sample rate,
  channels, video/audio codec, PDF page count, plugin version. Empty for files
  a field doesn't apply to, so one column serves every type.
- Backends are all macOS system frameworks (ImageIO header reads, AVFoundation,
  CoreGraphics/CGPDF) — no third-party libraries, no network. AVI is read with a
  self-contained RIFF avih parser since AVFoundation can't open it on macOS.
- Robust under DC's Lazarus/FPC runtime, which enables FP-exception traps: the
  plugin masks FP exceptions around every framework call and restores the host
  environment, fixing an "Access violation" crash triggered by ImageIO's RAW/
  MakerNote path on camera JPEGs (root-caused deterministically).
- Non-blocking: AVFoundation path honors CONTENT_DELAYIFSLOW; values cached per
  path+mtime. Universal (arm64 + x86_64), ad-hoc signed.
- Real-artifact harness dlopens the built .wdx and asserts field values against a
  synthesized PNG/PDF/WAV/AVI, the deferral protocol, and survival under FPC-style
  FP-exception traps (26/26). CI builds + runs it headlessly; release workflow on
  media-info-wdx-v* tags. Pre-commit hook builds + verifies its ABI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code-review follow-up. ContentGetValue previously returned ft_numeric_32 /
ft_numeric_floating even when maxlen was smaller than the value width (so it
skipped the store but still claimed success, leaving DC to read a stale buffer).
Return ft_fieldempty in that case. Latent in practice (DC always passes an
adequate buffer) but the ABI contract is now correct.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@NikolaiSachok NikolaiSachok merged commit d0efad4 into main Jun 24, 2026
2 checks passed
@NikolaiSachok NikolaiSachok deleted the media-info-wdx branch June 24, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant