Skip to content

Add EXIF photo importer - #72

Merged
rywall merged 12 commits into
masterfrom
exif-photo-importer
Sep 8, 2026
Merged

rywall merged 12 commits into
masterfrom
exif-photo-importer

Conversation

@Shup04

@Shup04 Shup04 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What

Adds SpatialFeatures::Importers::ExifPhoto for importing geotagged JPEGs as point features.

The importer:

  • Accepts an individual JPEG or a ZIP containing JPEGs.
  • Creates one importer and point feature per photo.
  • Reads latitude and longitude through EXIFR.
  • Includes capture time, altitude, and camera model as metadata.
  • Exposes each photo through importable_image_paths.
  • Skips photos without usable GPS coordinates with a warning.
  • Converts malformed JPEG errors into the existing ImportError path.
  • Uses content-based cache keys so temporary extraction paths do not affect caching.

Testing

Uses the real Nikon D7500 sample photos from the issue, including the five-photo ZIP.

  • Focused EXIF importer spec: 16 examples, 0 failures
  • Importer specs: 130 examples, 0 failures
  • Full suite: 318 examples, 0 failures, 19 pre-existing pending examples

The sample archive is approximately 42 MB and is included because the issue calls for fixtures produced by the real camera
rather than imitated files.

Follow-up

This PR only adds the importer to spatial_features. The PhotoMapLayer, uploader allowlists, attachment wiring,
permissions, and popup will be implemented in the application repository.

Part of: https://github.com/culturecode/stolo_connect/issues/2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Temporary-file ownership and below-sea-level altitude handling can produce failed imports or incorrect metadata.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds an EXIF-based importer for geotagged JPEGs and JPEG archives.

Changes:

  • Imports GPS points and photo metadata.
  • Supports ZIP extraction, warnings, cache keys, and image attachments.
  • Adds EXIFR and importer specs.
File summaries
File Description
lib/spatial_features/importers/exif_photo.rb Implements EXIF photo importing.
lib/spatial_features.rb Registers the importer.
spatial_features.gemspec Adds EXIFR dependency.
spec/lib/spatial_features/importers/exif_photo_spec.rb Tests importer behavior.
Review details
  • Files reviewed: 4/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/spatial_features/importers/exif_photo.rb
Comment thread lib/spatial_features/importers/exif_photo.rb

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Remote filenames, cache invalidation, and direct factory usage have unresolved correctness and API issues.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 5/7 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread lib/spatial_features/importers/exif_photo.rb Outdated
Comment thread lib/spatial_features/importers/exif_photo.rb Outdated
Comment thread lib/spatial_features/importers/exif_photo.rb
@Shup04
Shup04 force-pushed the exif-photo-importer branch from 3d1044a to 0b2b198 Compare September 8, 2026 20:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

ZIP staging can overwrite source entries, and basename-less remote URLs produce unstable cache keys.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 9/11 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread lib/spatial_features/importers/exif_photo.rb Outdated
Comment thread lib/spatial_features/importers/exif_photo.rb Outdated
Restore the tree to 4482103 as requested for the initial ZIP photo workflow. Defer staged tempfile ownership, remote filename handling, and filename-aware caching until production usage warrants them.
@rywall
rywall merged commit 66d4859 into master Sep 8, 2026
2 checks passed
rywall added a commit that referenced this pull request Sep 8, 2026
Releases the two commits merged since 3.12.0:

- 66d4859 Add EXIF photo importer (#72)
- d366ac3 Return the owning Tempfile from Download.open_each (#73)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwZduP5HbaZc6i2hoJwFJ5
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.

3 participants