Skip to content

feat: implement EXIF metadata extraction#38

Merged
Sid-352 merged 2 commits into
Sid-352:mainfrom
ankitasahu83964:feature/exif-metadata-extraction
May 31, 2026
Merged

feat: implement EXIF metadata extraction#38
Sid-352 merged 2 commits into
Sid-352:mainfrom
ankitasahu83964:feature/exif-metadata-extraction

Conversation

@ankitasahu83964
Copy link
Copy Markdown
Contributor

Description

This PR introduces EXIF-based metadata extraction support into EnvContext under the vigil-deep feature flag.

It enables extraction of:

  • Image camera model (ImgModel)
  • GPS coordinates (ImgGps)

The implementation uses kamadak-exif to read EXIF data safely and efficiently, and integrates it into the existing lazy evaluation system using OnceLock.

All computations are strictly feature-gated and do not affect builds where vigil-deep is disabled.

Why this is necessary

This enhancement improves Arbiter’s analytical capability by enabling deeper inspection of image files, allowing downstream workflows to make decisions based on camera metadata and geolocation when available.

Related Issue

Closes #13

Checklist

  • I have read the CONTRIBUTING.md guidelines.
  • My code passes cargo clippy -- -D warnings and cargo fmt.
  • I have included rationale-only comments for complex logic.
  • I have added or updated unit tests (if applicable).

AI-Generated Code Compliance

  • This PR contains code generated or assisted by an LLM.
  • I have manually reviewed, tested, and verified every line of this code. Any issues faced, created or caused by the code are my own fault.
  • I can fully explain the low-level mechanics of this implementation and guarantee it does not introduce memory leaks, race conditions, or undefined behavior.

@Sid-352
Copy link
Copy Markdown
Owner

Sid-352 commented May 30, 2026

Code is decent and wrapped in serde skipped as needed, but there are two issues that need to be fixed before we can merge;

  • Performance: rn compute_image_model and compute_image_gps both open the file and parse the EXIF data from scratch. If a decree checks both keys, we parse the file twice. Please consolidate this. Parse the file once, cache a combined struct (e.g., ExifCache { model, gps }) into a single OnceLock, and have the EnvKey matches read from that.
  • Dead Code: Please delete all the commented-out //use statements at the top of the file and the commented-out compute_exif_model block at the bottom.

After this ill squash and merge

@Sid-352 Sid-352 added nsoc26 Label for Nexus Spring of Code contributors level2 An advanced addition, bugfix or change labels May 30, 2026
@Sid-352 Sid-352 merged commit 19ec5b7 into Sid-352:main May 31, 2026
1 check passed
@Sid-352
Copy link
Copy Markdown
Owner

Sid-352 commented May 31, 2026

Merged, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level2 An advanced addition, bugfix or change nsoc26 Label for Nexus Spring of Code contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NSoC] Implement metadata extraction for Advanced Analytical Wards

2 participants